metrics_util::registry

Trait Storage

Source
pub trait Storage<K> {
    type Counter: CounterFn + Clone;
    type Gauge: GaugeFn + Clone;
    type Histogram: HistogramFn + Clone;

    // Required methods
    fn counter(&self, key: &K) -> Self::Counter;
    fn gauge(&self, key: &K) -> Self::Gauge;
    fn histogram(&self, key: &K) -> Self::Histogram;
}
Expand description

Defines the underlying storage for metrics as well as how to create them.

Required Associated Types§

Source

type Counter: CounterFn + Clone

The type used for counters.

Source

type Gauge: GaugeFn + Clone

The type used for gauges.

Source

type Histogram: HistogramFn + Clone

The type used for histograms.

Required Methods§

Source

fn counter(&self, key: &K) -> Self::Counter

Creates an empty counter.

Source

fn gauge(&self, key: &K) -> Self::Gauge

Creates an empty gauge.

Source

fn histogram(&self, key: &K) -> Self::Histogram

Creates an empty histogram.

Implementors§