pub struct EmaBaselineState {
pub sample_count: u64,
pub ema_mean: f64,
pub ema_variance: f64,
pub last_update: u64,
}Expand description
EMA (exponentially-weighted moving average) baseline state for a single (agent, metric) pair. Used by behavioral profiling to detect z-score anomalies without storing every historical sample.
The baseline uses Welford-style incremental tracking of mean and variance so callers can compute a z-score for any new sample without re-reading history.
Fields§
§sample_count: u64Number of samples folded into the baseline.
ema_mean: f64Exponentially-weighted mean.
ema_variance: f64Exponentially-weighted variance.
last_update: u64Last update timestamp (unix seconds).
Implementations§
Trait Implementations§
Source§impl Clone for EmaBaselineState
impl Clone for EmaBaselineState
Source§fn clone(&self) -> EmaBaselineState
fn clone(&self) -> EmaBaselineState
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for EmaBaselineState
impl Debug for EmaBaselineState
Source§impl Default for EmaBaselineState
impl Default for EmaBaselineState
Source§fn default() -> EmaBaselineState
fn default() -> EmaBaselineState
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for EmaBaselineState
impl<'de> Deserialize<'de> for EmaBaselineState
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>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for EmaBaselineState
impl PartialEq for EmaBaselineState
Source§impl Serialize for EmaBaselineState
impl Serialize for EmaBaselineState
impl StructuralPartialEq for EmaBaselineState
Auto Trait Implementations§
impl Freeze for EmaBaselineState
impl RefUnwindSafe for EmaBaselineState
impl Send for EmaBaselineState
impl Sync for EmaBaselineState
impl Unpin for EmaBaselineState
impl UnsafeUnpin for EmaBaselineState
impl UnwindSafe for EmaBaselineState
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