pub struct AlertEvaluator { /* private fields */ }Expand description
Consumes events and snapshots, applying AlertRules and emitting
RuleAlerts with hysteresis and cooldown.
The evaluator is !Sync-free (it is plain Send state) and intended to be
driven from a single monitoring task. Call observe_event
for each incoming Event and observe_snapshot
for each periodic EventSnapshot; both return any alerts produced.
Implementations§
Source§impl AlertEvaluator
impl AlertEvaluator
Sourcepub fn rule_count(&self) -> usize
pub fn rule_count(&self) -> usize
Number of configured rules.
Sourcepub fn observe_event(&mut self, event: &Event) -> Vec<RuleAlert>
pub fn observe_event(&mut self, event: &Event) -> Vec<RuleAlert>
Observe a single event, updating internal windows and evaluating rules.
Returns any alerts (firing or resolved) produced as a result.
Sourcepub fn observe_snapshot(&mut self, snapshot: &EventSnapshot) -> Vec<RuleAlert>
pub fn observe_snapshot(&mut self, snapshot: &EventSnapshot) -> Vec<RuleAlert>
Observe a periodic snapshot, evaluating snapshot-driven rules.
Returns any alerts produced. Queue-depth and no-heartbeat rules are primarily evaluated here; failure-rate rules also incorporate the snapshot’s completed counts as additional samples.
Trait Implementations§
Source§impl Debug for AlertEvaluator
impl Debug for AlertEvaluator
Auto Trait Implementations§
impl Freeze for AlertEvaluator
impl RefUnwindSafe for AlertEvaluator
impl Send for AlertEvaluator
impl Sync for AlertEvaluator
impl Unpin for AlertEvaluator
impl UnsafeUnpin for AlertEvaluator
impl UnwindSafe for AlertEvaluator
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