[][src]Trait metrics_core::Recorder

pub trait Recorder {
    fn record_counter<K: Into<Key>>(&mut self, key: K, value: u64);
fn record_gauge<K: Into<Key>>(&mut self, key: K, value: i64);
fn record_histogram<K: Into<Key>>(&mut self, key: K, values: &[u64]); }

A value that records metrics.

Required methods

fn record_counter<K: Into<Key>>(&mut self, key: K, value: u64)

Records a counter.

From the perspective of an recorder, a counter and gauge are essentially identical, insofar as they are both a single value tied to a key. From the perspective of a collector, counters and gauges usually have slightly different modes of operation.

For the sake of flexibility on the exporter side, both are provided.

fn record_gauge<K: Into<Key>>(&mut self, key: K, value: i64)

Records a gauge.

From the perspective of a recorder, a counter and gauge are essentially identical, insofar as they are both a single value tied to a key. From the perspective of a collector, counters and gauges usually have slightly different modes of operation.

For the sake of flexibility on the exporter side, both are provided.

fn record_histogram<K: Into<Key>>(&mut self, key: K, values: &[u64])

Records a histogram.

Recorders are expected to tally their own histogram views, so this will be called with all of the underlying observed values, and callers will need to process them accordingly.

There is no guarantee that this method will not be called multiple times for the same key.

Loading content...

Implementors

Loading content...