pub struct EmitterState {
pub context: Context,
pub last_seen: u64,
pub message_count: u64,
pub recent_values: Vec<f64>,
pub is_anomalous: bool,
/* private fields */
}Expand description
State for a single emitter
Fields§
§context: ContextEmitter’s context
last_seen: u64Last seen timestamp
message_count: u64Message count from this emitter
recent_values: Vec<f64>Recent values (for cross-fleet comparison)
is_anomalous: boolIs this emitter behaving anomalously?
Implementations§
Source§impl EmitterState
impl EmitterState
Sourcepub fn with_capacity(max_recent: usize) -> Self
pub fn with_capacity(max_recent: usize) -> Self
Create with custom recent values capacity
Sourcepub fn record_value(&mut self, value: f64, timestamp: u64)
pub fn record_value(&mut self, value: f64, timestamp: u64)
Record a new value
Sourcepub fn last_value(&self) -> Option<f64>
pub fn last_value(&self) -> Option<f64>
Get the last recorded value
Trait Implementations§
Source§impl Debug for EmitterState
impl Debug for EmitterState
Auto Trait Implementations§
impl Freeze for EmitterState
impl RefUnwindSafe for EmitterState
impl Send for EmitterState
impl Sync for EmitterState
impl Unpin for EmitterState
impl UnsafeUnpin for EmitterState
impl UnwindSafe for EmitterState
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