pub trait StatDefinition: Debug {
    // Required methods
    fn name(&self) -> &'static str;
    fn description(&self) -> &'static str;
    fn stype(&self) -> StatType;
    fn group_by(&self) -> Vec<&'static str>;
    fn buckets(&self) -> Option<Buckets>;
}
Expand description

A configured statistic, defined in terms of the external logs that trigger it to change.

These definitions are provided at start of day to populate the tracker.

These should NOT be constructed directly but by using the define_stats macro.

Required Methods§

source

fn name(&self) -> &'static str

The name of this metric. This name is reported in logs as the metric_name field.

source

fn description(&self) -> &'static str

A human readable-description of the statistic, describing its meaning. When logged this is the log message.

source

fn stype(&self) -> StatType

The type of statistic.

source

fn group_by(&self) -> Vec<&'static str>

An optional list of field names to group the statistic by.

source

fn buckets(&self) -> Option<Buckets>

An optional set of numerical buckets to group the statistic by.

Implementors§