[−][src]Trait metrics_core::MetricsRecorder
A value that records collected metrics.
Required methods
fn record_counter<K: AsRef<str>>(&mut self, key: K, value: u64)
Records a counter value.
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 recording side, we provide both.
fn record_gauge<K: AsRef<str>>(&mut self, key: K, value: i64)
Records a gauge value.
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 recording side, we provide both.
fn record_histogram<K: AsRef<str>>(&mut self, key: K, quantiles: &[(f64, u64)])
Records a histogram.
The quantiles are expected to be in the format of (quantile, value_at_quantile).
Quantiles are a value from 0 to 1, inclusive. Values outside of this range are considered invalid, but it is an implementation detail of the recorder on how to handle them.