Skip to main content

Aggregator

Trait Aggregator 

Source
pub trait Aggregator: Send + Sync {
    // Required methods
    fn update(&mut self, value: f64);
    fn value(&self) -> f64;
    fn reset(&mut self);
}
Expand description

Accumulates a stream of f64 values into a single summary statistic.

Implement this to add custom aggregators. Built-ins: Mean, Max, Min, Last, RollingMean.

Required Methods§

Source

fn update(&mut self, value: f64)

Record a new value.

Source

fn value(&self) -> f64

Return the current aggregate. f64::NAN if no values have been seen.

Source

fn reset(&mut self)

Clear all accumulated values, as if freshly constructed.

Implementors§