Trait metrics::Recorder [−][src]
A trait for registering and recording metrics.
This is the core trait that allows interoperability between exporter implementations and the
macros provided by metrics
.
Required methods
fn register_counter(
&self,
key: Key,
unit: Option<Unit>,
description: Option<&'static str>
)
[src]
&self,
key: Key,
unit: Option<Unit>,
description: Option<&'static str>
)
Registers a counter.
Callers may provide the unit or a description of the counter being registered. Whether or not a metric can be reregistered to provide a unit/description, if one was already passed or not, as well as how units/descriptions are used by the underlying recorder, is an implementation detail.
fn register_gauge(
&self,
key: Key,
unit: Option<Unit>,
description: Option<&'static str>
)
[src]
&self,
key: Key,
unit: Option<Unit>,
description: Option<&'static str>
)
Registers a gauge.
Callers may provide the unit or a description of the gauge being registered. Whether or not a metric can be reregistered to provide a unit/description, if one was already passed or not, as well as how units/descriptions are used by the underlying recorder, is an implementation detail.
fn register_histogram(
&self,
key: Key,
unit: Option<Unit>,
description: Option<&'static str>
)
[src]
&self,
key: Key,
unit: Option<Unit>,
description: Option<&'static str>
)
Registers a histogram.
Callers may provide the unit or a description of the histogram being registered. Whether or not a metric can be reregistered to provide a unit/description, if one was already passed or not, as well as how units/descriptions are used by the underlying recorder, is an implementation detail.
fn increment_counter(&self, key: Key, value: u64)
[src]
Increments a counter.
fn update_gauge(&self, key: Key, value: GaugeValue)
[src]
Updates a gauge.
fn record_histogram(&self, key: Key, value: f64)
[src]
Records a histogram.
Implementors
impl Recorder for NoopRecorder
[src]
fn register_counter(
&self,
_key: Key,
_unit: Option<Unit>,
_description: Option<&'static str>
)
[src]
&self,
_key: Key,
_unit: Option<Unit>,
_description: Option<&'static str>
)
fn register_gauge(
&self,
_key: Key,
_unit: Option<Unit>,
_description: Option<&'static str>
)
[src]
&self,
_key: Key,
_unit: Option<Unit>,
_description: Option<&'static str>
)
fn register_histogram(
&self,
_key: Key,
_unit: Option<Unit>,
_description: Option<&'static str>
)
[src]
&self,
_key: Key,
_unit: Option<Unit>,
_description: Option<&'static str>
)