pub struct AdaptiveTtlConfig {
pub min_ttl_secs: u32,
pub max_ttl_secs: u32,
pub grace_secs: u32,
pub max_heartbeats_per_second: u32,
pub failover_ttl_secs: u32,
}Expand description
Adaptive-TTL heartbeat configuration. Mirrors Nomad’s design: the leader caps cluster-wide heartbeat rate to a constant by stretching individual workers’ TTLs as the cluster grows.
Fields§
§min_ttl_secs: u32§max_ttl_secs: u32§grace_secs: u32§max_heartbeats_per_second: u32§failover_ttl_secs: u32Implementations§
Source§impl AdaptiveTtlConfig
impl AdaptiveTtlConfig
Sourcepub fn compute_ttl(&self, n_workers: u32) -> u32
pub fn compute_ttl(&self, n_workers: u32) -> u32
Compute the TTL to hand a worker, given the current cluster
size. Formula matches Nomad: clamp(N / max_hb_per_sec, min, max).
Trait Implementations§
Source§impl Clone for AdaptiveTtlConfig
impl Clone for AdaptiveTtlConfig
Source§fn clone(&self) -> AdaptiveTtlConfig
fn clone(&self) -> AdaptiveTtlConfig
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for AdaptiveTtlConfig
impl Debug for AdaptiveTtlConfig
Source§impl Default for AdaptiveTtlConfig
impl Default for AdaptiveTtlConfig
Source§impl<'de> Deserialize<'de> for AdaptiveTtlConfig
impl<'de> Deserialize<'de> for AdaptiveTtlConfig
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for AdaptiveTtlConfig
impl RefUnwindSafe for AdaptiveTtlConfig
impl Send for AdaptiveTtlConfig
impl Sync for AdaptiveTtlConfig
impl Unpin for AdaptiveTtlConfig
impl UnsafeUnpin for AdaptiveTtlConfig
impl UnwindSafe for AdaptiveTtlConfig
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more