pub trait StatsManager {
    // Required methods
    fn aggregate(&self);
    fn create_counter(&self, name: &str) -> BoxLocalCounter;
    fn create_timeseries(
        &self,
        name: &str,
        aggregation_types: &[AggregationType],
        intervals: &[Duration]
    ) -> BoxLocalTimeseries;
    fn create_histogram(
        &self,
        name: &str,
        aggregation_types: &[AggregationType],
        conf: BucketConfig,
        percentiles: &[u8]
    ) -> BoxLocalHistogram;
    fn create_quantile_stat(
        &self,
        name: &str,
        aggregation_types: &[AggregationType],
        percentiles: &[f32],
        intervals: &[Duration]
    ) -> BoxHistogram;
}

Required Methods§

source

fn aggregate(&self)

Function to be called periodically to aggregate all the stats owned by this manager.

source

fn create_counter(&self, name: &str) -> BoxLocalCounter

Create a new instance of BoxLocalCounter and bind it to self for aggregation purposes. Provided name is the name of the counter.

source

fn create_timeseries( &self, name: &str, aggregation_types: &[AggregationType], intervals: &[Duration] ) -> BoxLocalTimeseries

Create new instance of BoxLocalTimeseries and bind it to self for aggregation purposes. Provided name is the name of the timeseries. AggregationType decides which types of aggragation are exported by the returned timeseries. The actual implementation is free to assume some defaults if aggregation_type is empty. The intervals provides a list of intervals at which data should be aggregated, the actual implementation is free (and encouraged) to assume some defaults if intervals is empty.

source

fn create_histogram( &self, name: &str, aggregation_types: &[AggregationType], conf: BucketConfig, percentiles: &[u8] ) -> BoxLocalHistogram

Create new instance of BoxLocalHistogram and bind it to self for aggregation purposes. Provided name is the name of the histogram. BucketConfig configures the aggregation bucket. AggregationType decides which types of aggregation are exported by the returned timeseries. The actual implementation is free to assume some defaults if aggregation_type is empty. The percentiles provides a list of percentiles for the aggregation aggregated, the actual implementation is free (and encouraged to) assume some defaults if intervals is empty.

source

fn create_quantile_stat( &self, name: &str, aggregation_types: &[AggregationType], percentiles: &[f32], intervals: &[Duration] ) -> BoxHistogram

Create new instance of QuantileStat and bind it to self for aggregation purposes. Provided name is the name of the QuantileStat. AggregationType decides which types of aggregation are exported by the returned timeseries. The actual implementation is free to assume some defaults if aggregation_type is empty. The percentiles provides a list of percentiles for the aggregation aggregated, the actual implementation is free (and encouraged to) assume some defaults if intervals is empty. The intervals provides a list of intervals at which data should be aggregated, the actual implementation is free (and encouraged) to assume some defaults if intervals is empty.

Implementations on Foreign Types§

source§

impl<T: StatsManager + ?Sized> StatsManager for Box<T>

source§

fn aggregate(&self)

source§

fn create_counter(&self, name: &str) -> BoxLocalCounter

source§

fn create_timeseries( &self, name: &str, aggregation_types: &[AggregationType], intervals: &[Duration] ) -> BoxLocalTimeseries

source§

fn create_histogram( &self, name: &str, aggregation_types: &[AggregationType], conf: BucketConfig, percentiles: &[u8] ) -> BoxLocalHistogram

source§

fn create_quantile_stat( &self, name: &str, aggregation_types: &[AggregationType], percentiles: &[f32], intervals: &[Duration] ) -> BoxHistogram

Implementors§