pub struct HealthThresholdModel { /* private fields */ }Expand description
Learned health check thresholds replacing fixed probe configuration.
Inputs (3): service_type_ordinal, history_depth (sample count), recent_latency_ms Outputs (2): degraded_threshold (consecutive failures), failed_threshold
Fallback: degraded = 1 failure, failed = 3 failures (from ProbeConfig defaults).
Implementations§
Source§impl HealthThresholdModel
impl HealthThresholdModel
Sourcepub fn drain_events(&mut self) -> Vec<EmlEvent>
pub fn drain_events(&mut self) -> Vec<EmlEvent>
Drain accumulated EML lifecycle events for ExoChain forwarding.
Sourcepub fn is_trained(&self) -> bool
pub fn is_trained(&self) -> bool
Whether the model has been trained.
Sourcepub fn training_sample_count(&self) -> usize
pub fn training_sample_count(&self) -> usize
Number of training samples collected.
Sourcepub fn predict(
&self,
service_type: u32,
history_depth: u32,
recent_latency_ms: f64,
) -> (u32, u32)
pub fn predict( &self, service_type: u32, history_depth: u32, recent_latency_ms: f64, ) -> (u32, u32)
Predict health thresholds: (degraded_threshold, failed_threshold).
Both values are clamped to [1, 20] and rounded to integers.
When untrained, returns (1, 3) matching ProbeConfig defaults.
Sourcepub fn record(
&mut self,
service_type: u32,
history_depth: u32,
recent_latency_ms: f64,
optimal_degraded: u32,
optimal_failed: u32,
)
pub fn record( &mut self, service_type: u32, history_depth: u32, recent_latency_ms: f64, optimal_degraded: u32, optimal_failed: u32, )
Record a confirmed health alert for training.
was_true_positive: true if the alert correctly identified a problem.
optimal_degraded / optimal_failed: retrospective best thresholds.
Trait Implementations§
Source§impl Clone for HealthThresholdModel
impl Clone for HealthThresholdModel
Source§impl Debug for HealthThresholdModel
impl Debug for HealthThresholdModel
Source§impl Default for HealthThresholdModel
impl Default for HealthThresholdModel
Source§impl<'de> Deserialize<'de> for HealthThresholdModel
impl<'de> Deserialize<'de> for HealthThresholdModel
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 HealthThresholdModel
impl RefUnwindSafe for HealthThresholdModel
impl Send for HealthThresholdModel
impl Sync for HealthThresholdModel
impl Unpin for HealthThresholdModel
impl UnsafeUnpin for HealthThresholdModel
impl UnwindSafe for HealthThresholdModel
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