Struct metriki_core::MetricsRegistry
source · [−]pub struct MetricsRegistry { /* private fields */ }
Expand description
Entrypoint of all metrics
Implementations
Create a default metrics registry
Create a default metrics registry wrapped in an Arc.
Return Meter
that has been registered and create if not found.
Meter a metric to measure rate of an event. It will report rate in 1 minute, 5 minutes and 15 minutes, which is similar to Linux load.
Panics
This function may panic if a metric is already registered with type other than meter.
Return Histogram
that has been registered and create if not found.
Histogram a metric to measure distribution of a series of data. The distribution will
be reported with max
, min
, mean
, stddev
and the value at particular percentile.
Panics
This function may panic if a metric is already registered with type other than histogram.
Return Counter
that has been registered and create if not found.
Counter a metric to measure the number of some state.
Panics
This function may panic if a metric is already registered with type other than counter.
Return Timer
that has been registered and create if not found.
Timer is a combination of meter and histogram. The meter part is to track rate of the event. And the histogram part maintains the distribution of time spent for the event.
Panics
This function may panic if a metric is already registered with type other than counter.
Register a Gauge
with given function.
The guage will return a value when any reporter wants to fetch data from it.
Returns all the metrics hold in the registry. Metrics is filtered if a filter is set for this registry.
This is useful for reporters to fetch all values from the registry.
Set a filter for this registry.
The filter will apply to snapshots
function.
Register a MetricsSet implementation.
A MetricsSet returns a set of metrics when snapshots()
is called on
the registry. This provides dynamic metrics that can be added into registry
based custom rules.
The name has nothing to do with metrics it added to snapshots()
results.
It’s just for identify the metrics set for dedup and removal.
Unregister a MetricsSet implementation by its name.