pub trait Statistic: Clone + Fill<Self::Sample> {
    type Semantic: DataSemantic;
    type Sample: Clone;
    type Aggregation: Clone;

    // Required methods
    fn reset(&mut self);
    fn aggregation(&self) -> Option<Self::Aggregation>;
}
Expand description

A Sampler that folds samples into a statistical aggregation.

Required Associated Types§

source

type Semantic: DataSemantic

The type of data semantic associated with samples.

source

type Sample: Clone

The type of samples.

source

type Aggregation: Clone

The type of the statistical aggregation.

Required Methods§

source

fn reset(&mut self)

Resets the state (and aggregation) of the statistic.

The state of a statistic after a reset is arbitrary, but most types reset to a reasonable initial state via Default. Some types do nothing, such as LatchMax, which operates across [SamplingInterval]s.

Statistics can be configured to reset to any given state via Reset.

LatchMax crate::experimental::series::statistic::LatchMax Reset crate::experimental::series::statistic::Reset

source

fn aggregation(&self) -> Option<Self::Aggregation>

Gets the statistical aggregation.

Returns None if no aggregation is ready.

Object Safety§

This trait is not object safe.

Implementors§