pub trait StreamingStatistic {
type Type;
// Required methods
fn add_sample(&mut self, sample: Self::Type) -> Self::Type;
fn get_last_sample(&self) -> Self::Type;
fn get_last_result(&self) -> Self::Type;
fn get_num_samples(&self) -> u64;
}
Expand description
A statistic type that can be incrementally calculated after each sample is added. Does not necessarily have to have the full set of data available to it, and as such, should be fast.
Required Associated Types§
Required Methods§
Sourcefn add_sample(&mut self, sample: Self::Type) -> Self::Type
fn add_sample(&mut self, sample: Self::Type) -> Self::Type
adds a sample to this streaming statistic, returning a result of the operation.
Sourcefn get_last_sample(&self) -> Self::Type
fn get_last_sample(&self) -> Self::Type
Returns a copy of the last sample added
Sourcefn get_last_result(&self) -> Self::Type
fn get_last_result(&self) -> Self::Type
Returns the last value returned by ‘add_sample’
Sourcefn get_num_samples(&self) -> u64
fn get_num_samples(&self) -> u64
Returns the total number of samples pushed in