Trait stats::prelude::Timeseries

source ·
pub trait Timeseries {
    // Required methods
    fn add_value(&self, value: i64);
    fn add_value_aggregated(&self, value: i64, nsamples: u32);
}
Expand description

Timeseries is a type of stat that can aggregate data send to it into predefined intervals of time. Example aggregations are average, sum or rate.

Required Methods§

source

fn add_value(&self, value: i64)

Adds value to the timeseries. It is being aggregated based on ExportType

source

fn add_value_aggregated(&self, value: i64, nsamples: u32)

You might want to call this method when you have a very hot counter to avoid some congestions on it. Value is the sum of values of the samples and nsamples is the number of samples. Please notice that difference in the value semantic compared to Histogram::add_repeated_value.

Implementations on Foreign Types§

source§

impl<T> Timeseries for Box<T>
where T: Timeseries + ?Sized,

source§

fn add_value(&self, value: i64)

source§

fn add_value_aggregated(&self, value: i64, nsamples: u32)

Implementors§