Struct telemetry::keyed::KeyedCount [] [src]

pub struct KeyedCount<K> {
    // some fields omitted
}

Count histograms.

A Count histogram simply accumulates the numbers passed with record().

With SerializationFormat::SimpleJson, these histograms are serialized as an object, with keys sorted, in which each field is a number.

Methods

impl<K> KeyedCount<K>

fn new(service: &Service, name: String) -> KeyedCount<K>

Create a new KeyedCount 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<K> KeyedHistogram<K, u32> for KeyedCount<K> where K: ToString

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

fn record(&self, key: K, value: T)

impl<K> Clone for KeyedCount<K>

fn clone(&self) -> Self

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