pub struct LabeledMetric<T> { /* private fields */ }
Expand description

A labeled metric.

Labeled metrics allow to record multiple sub-metrics of the same type under different string labels.

Implementations§

Creates a new labeled metric from the given metric instance and optional list of labels.

See get for information on how static or dynamic labels are handled.

Gets a specific metric for a given label.

If a set of acceptable labels were specified in the metrics.yaml file, and the given label is not in the set, it will be recorded under the special OTHER_LABEL label.

If a set of acceptable labels was not specified in the metrics.yaml file, only the first 16 unique labels will be used. After that, any additional labels will be recorded under the special OTHER_LABEL label.

Labels must be snake_case and less than 30 characters. If an invalid label is used, the metric will be recorded in the special OTHER_LABEL label.

Exported for test purposes.

Gets the number of recorded errors for the given metric and error type.

Arguments
  • error - The type of error
Returns

The number of errors reported.

Trait Implementations§

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Create a new handle for an Arc value Read more
Clone a handle Read more
Consume a handle, getting back the initial Arc<>
Get a clone of the Arc<> using a “borrowed” handle. Read more

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.