[][src]Trait metrics::Recorder

pub trait Recorder {
    fn record_counter(&self, key: Key, value: u64);
fn record_gauge(&self, key: Key, value: i64);
fn record_histogram(&self, key: Key, value: u64); }

A value that records metrics behind the facade.

Required methods

fn record_counter(&self, key: Key, 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(&self, key: Key, 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(&self, key: Key, value: 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...