glean / mozilla.telemetry.glean.private / LabeledMetricType / get

get

operator fun get(label: String): T

Get the 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__.

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.

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.

Parameters

label - The label

Return
The specific metric for that label

operator fun get(labelIndex: Int): T

Get the specific metric for a given label index.

This only works if a set of acceptable labels were specified in the metrics.yaml file. If static labels were not defined in that file or the index of the given label is not in the set, it will be recorded under the special __other__.

Parameters

labelIndex - The label

Return
The specific metric for that label