pub struct MetricName { /* private fields */ }Expand description
The MetricName class encapsulates a metric’s name, logical group and its
related attributes. It should be constructed using Metrics::metric_name(...).
This class captures the following parameters:
name: The name of the metricgroup: logical group name of the metrics to which this metric belongs.description: A human-readable description to include in the metric. This is optional.tags: additional key/value attributes of the metric. This is optional.
group and tags parameters can be used to create unique metric names while
reporting in any custom reporting.
Two MetricNames are equal if their name, group, and tags match;
description is intentionally excluded from equality and hashing, matching
the Java implementation.
Implementations§
Source§impl MetricName
impl MetricName
Sourcepub fn new(
name: impl Into<String>,
group: impl Into<String>,
description: impl Into<String>,
tags: BTreeMap<String, String>,
) -> Self
pub fn new( name: impl Into<String>, group: impl Into<String>, description: impl Into<String>, tags: BTreeMap<String, String>, ) -> Self
Create a MetricName.
Please create MetricName via crate::common::metrics::Metrics::metric_name_description_tags.
name- The name of the metricgroup- logical group name of the metrics to which this metric belongsdescription- A human-readable description to include in the metrictags- additional key/value attributes of the metric
Sourcepub fn group(&self) -> &str
pub fn group(&self) -> &str
The logical group name of the metrics to which this metric belongs.
The additional key/value attributes of the metric.
Sourcepub fn description(&self) -> &str
pub fn description(&self) -> &str
A human-readable description of the metric.
Trait Implementations§
Source§impl Clone for MetricName
impl Clone for MetricName
Source§fn clone(&self) -> MetricName
fn clone(&self) -> MetricName
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for MetricName
impl Debug for MetricName
Source§impl Display for MetricName
impl Display for MetricName
Source§impl Hash for MetricName
impl Hash for MetricName
Source§impl PartialEq for MetricName
impl PartialEq for MetricName
impl Eq for MetricName
Auto Trait Implementations§
impl Freeze for MetricName
impl RefUnwindSafe for MetricName
impl Send for MetricName
impl Sync for MetricName
impl Unpin for MetricName
impl UnsafeUnpin for MetricName
impl UnwindSafe for MetricName
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more