Trait stats_traits::stats_manager::StatsManager
source · 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§
sourcefn aggregate(&self)
fn aggregate(&self)
Function to be called periodically to aggregate all the stats owned by this manager.
sourcefn create_counter(&self, name: &str) -> BoxLocalCounter
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.
sourcefn create_timeseries(
&self,
name: &str,
aggregation_types: &[AggregationType],
intervals: &[Duration]
) -> BoxLocalTimeseries
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.
sourcefn create_histogram(
&self,
name: &str,
aggregation_types: &[AggregationType],
conf: BucketConfig,
percentiles: &[u8]
) -> BoxLocalHistogram
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.
sourcefn create_quantile_stat(
&self,
name: &str,
aggregation_types: &[AggregationType],
percentiles: &[f32],
intervals: &[Duration]
) -> BoxHistogram
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.