Struct telemetry::plain::Count [] [src]

pub struct Count {
    // some fields omitted
}

Count histograms.

A Count histogram simply accumulates the numbers passed with record(). Count histograms are useful, for instance, to know how many times a feature has been used, or how many times an error has been triggered.

With SerializationFormat::SimpleJson, these histograms are serialized as a plain number.

Methods

impl Count

fn new(service: &Service, name: String) -> Count

Create a new Count histogram with a given name.

Argument name is used as key when processing and exporting the data. Each name must be unique to the Service.

Panics

If name is already used by another histogram in service.

Trait Implementations

impl Histogram<u32> for Count

fn record_cb<F>(&self, cb: F) where F: FnOnce() -> Option<u32>

fn record(&self, value: T)

Derived Implementations

impl Clone for Count

fn clone(&self) -> Count

fn clone_from(&mut self, source: &Self)