pub struct DualLabeledCounterMetric { /* private fields */ }
Expand description
A dual labled metric
Dual labled metrics allow recording multiple sub-metrics of the same type, in relation to two dimensions rather than the single label provided by the standard labeled type.
Implementations§
Source§impl DualLabeledCounterMetric
impl DualLabeledCounterMetric
Sourcepub fn new(
meta: CommonMetricData,
keys: Option<Vec<Cow<'static, str>>>,
catgories: Option<Vec<Cow<'static, str>>>,
) -> DualLabeledCounterMetric
pub fn new( meta: CommonMetricData, keys: Option<Vec<Cow<'static, str>>>, catgories: Option<Vec<Cow<'static, str>>>, ) -> DualLabeledCounterMetric
Creates a new dual labeled counter from the given metric instance and optional list of labels.
Sourcepub fn get<S: AsRef<str>>(&self, key: S, category: S) -> Arc<CounterMetric>
pub fn get<S: AsRef<str>>(&self, key: S, category: S) -> Arc<CounterMetric>
Gets a specific metric for a given key/category combination.
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 have a maximum of 111 characters, and may comprise any printable ASCII characters.
If an invalid label is used, the metric will be recorded in the special OTHER_LABEL
label.