Struct glean_core::metrics::LabeledMetric[][src]

pub struct LabeledMetric<T> { /* fields omitted */ }
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.

Gets the template submetric.

The template submetric is the actual metric that is cloned and modified to record for a specific label.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

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

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

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.