pub struct OnlineStats { /* private fields */ }Expand description
Online mean/variance accumulator for building EntityBaseline values.
Uses Welford’s algorithm, so callers can update an environmental baseline one observation at a time without storing raw samples.
Implementations§
Source§impl OnlineStats
impl OnlineStats
pub fn new() -> Self
pub fn push(&mut self, value: f64)
pub fn count(&self) -> u64
pub fn is_empty(&self) -> bool
pub fn mean(&self) -> f64
pub fn std_dev(&self) -> f64
pub fn to_baseline( &self, entity: impl Into<String>, metric: impl Into<String>, ) -> EntityBaseline
Trait Implementations§
Source§impl Clone for OnlineStats
impl Clone for OnlineStats
Source§fn clone(&self) -> OnlineStats
fn clone(&self) -> OnlineStats
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 OnlineStats
impl Debug for OnlineStats
Source§impl Default for OnlineStats
impl Default for OnlineStats
Source§fn default() -> OnlineStats
fn default() -> OnlineStats
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for OnlineStats
impl<'de> Deserialize<'de> for OnlineStats
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
Auto Trait Implementations§
impl Freeze for OnlineStats
impl RefUnwindSafe for OnlineStats
impl Send for OnlineStats
impl Sync for OnlineStats
impl Unpin for OnlineStats
impl UnsafeUnpin for OnlineStats
impl UnwindSafe for OnlineStats
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