pub struct ProbeConfig {
pub liveness_interval_secs: u64,
pub readiness_interval_secs: u64,
pub failure_threshold: u32,
pub success_threshold: u32,
}Expand description
Configuration for liveness and readiness probes.
Fields§
§liveness_interval_secs: u64How often to check liveness (default: 10s).
readiness_interval_secs: u64How often to check readiness (default: 5s).
failure_threshold: u32Number of consecutive failures before marking as failed.
success_threshold: u32Number of consecutive successes before marking as recovered.
Implementations§
Source§impl ProbeConfig
impl ProbeConfig
Sourcepub fn from_model(
model: Option<&HealthThresholdModel>,
service_type: u32,
history_depth: u32,
recent_latency_ms: f64,
) -> Self
pub fn from_model( model: Option<&HealthThresholdModel>, service_type: u32, history_depth: u32, recent_latency_ms: f64, ) -> Self
Derive a ProbeConfig using an optional learned
HealthThresholdModel.
The model’s two output heads (degraded, failed) map onto
(success_threshold, failure_threshold) respectively: the
failed head sets the number of consecutive probe failures
before the service is marked failed, and the degraded head
is treated as the number of consecutive successes required to
mark recovery (a higher value makes recovery more conservative).
When model is None or untrained, returns
Self::default — i.e. failure_threshold=3,
success_threshold=1 — exactly reproducing today’s behaviour.
service_type, history_depth, and recent_latency_ms feed
the EML model when it is trained; callers without those
signals can pass (0, 0, 0.0).
NOTE(eml-swap): wired — Finding #5 (HealthThresholdModel).
Trait Implementations§
Source§impl Clone for ProbeConfig
impl Clone for ProbeConfig
Source§impl Debug for ProbeConfig
impl Debug for ProbeConfig
Source§impl Default for ProbeConfig
Available on crate feature os-patterns only.
impl Default for ProbeConfig
os-patterns only.Source§impl<'de> Deserialize<'de> for ProbeConfig
impl<'de> Deserialize<'de> for ProbeConfig
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>,
Auto Trait Implementations§
impl Freeze for ProbeConfig
impl RefUnwindSafe for ProbeConfig
impl Send for ProbeConfig
impl Sync for ProbeConfig
impl Unpin for ProbeConfig
impl UnsafeUnpin for ProbeConfig
impl UnwindSafe for ProbeConfig
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<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more