pub struct EffectiveConfig {
pub target_version: Option<String>,
pub target_version_jitter: String,
pub heartbeat_interval: String,
pub host_perf_interval: String,
pub process_perf_enabled: bool,
pub process_perf_expires_at: Option<DateTime<Utc>>,
pub process_perf_top_n: u32,
}Expand description
Concrete config the agent runs against once the scope stack has
been flattened. target_version stays Option because “no
rollout target set anywhere” is a meaningful state (the agent
just keeps running the version it has); the other fields always
have a value, falling back to EffectiveConfig::builtin_defaults
when no scope sets them.
Fields§
§target_version: Option<String>§target_version_jitter: String§heartbeat_interval: String§host_perf_interval: String§process_perf_enabled: boolv0.41 / Phase 2 — see ConfigScope::process_perf_enabled.
process_perf_expires_at: Option<DateTime<Utc>>v0.41 / Phase 2 — see ConfigScope::process_perf_expires_at.
process_perf_top_n: u32v0.41 / Phase 2 — see ConfigScope::process_perf_top_n.
Implementations§
Source§impl EffectiveConfig
impl EffectiveConfig
Sourcepub fn builtin_defaults() -> Self
pub fn builtin_defaults() -> Self
Floor values used when no KV scope sets a given field.
Sourcepub fn process_perf_active_at(&self, now: DateTime<Utc>) -> bool
pub fn process_perf_active_at(&self, now: DateTime<Utc>) -> bool
Returns true when process-perf collection should actually run right now: the flag is set AND no expiry has passed. Centralised here so agent / backend / SPA all agree on the active-vs-expired distinction.
Sourcepub fn heartbeat_duration(&self) -> Duration
pub fn heartbeat_duration(&self) -> Duration
Parsed heartbeat_interval, falling back to the built-in
30 s default on a malformed string. Logging the parse error
is the caller’s job (so that test code can stay quiet).
Sourcepub fn host_perf_duration(&self) -> Duration
pub fn host_perf_duration(&self) -> Duration
Parsed host_perf_interval, falling back to the built-in
60 s default on a malformed string.
Sourcepub fn target_version_jitter_duration(&self) -> Duration
pub fn target_version_jitter_duration(&self) -> Duration
Parsed target_version_jitter, falling back to zero (= no
jitter) on a malformed string. Zero means “start downloading
immediately when target_version drifts” — fine for small
fleets / canary smoke tests, bad for 3000 hosts.
Trait Implementations§
Source§impl Clone for EffectiveConfig
impl Clone for EffectiveConfig
Source§fn clone(&self) -> EffectiveConfig
fn clone(&self) -> EffectiveConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for EffectiveConfig
impl Debug for EffectiveConfig
Source§impl Default for EffectiveConfig
impl Default for EffectiveConfig
Source§impl<'de> Deserialize<'de> for EffectiveConfig
impl<'de> Deserialize<'de> for EffectiveConfig
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>,
impl Eq for EffectiveConfig
Source§impl PartialEq for EffectiveConfig
impl PartialEq for EffectiveConfig
Source§fn eq(&self, other: &EffectiveConfig) -> bool
fn eq(&self, other: &EffectiveConfig) -> bool
self and other values to be equal, and is used by ==.Source§impl Serialize for EffectiveConfig
impl Serialize for EffectiveConfig
impl StructuralPartialEq for EffectiveConfig
Auto Trait Implementations§
impl Freeze for EffectiveConfig
impl RefUnwindSafe for EffectiveConfig
impl Send for EffectiveConfig
impl Sync for EffectiveConfig
impl Unpin for EffectiveConfig
impl UnsafeUnpin for EffectiveConfig
impl UnwindSafe for EffectiveConfig
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.