public class MetricID extends java.lang.Object implements java.lang.Comparable<MetricID>
Metric and Metadata that are registered
in the MetricRegistry
The MetricID contains:
Name: (Required) The name of the metric.
Tags: (Optional) The tags (represented by Tag objects)
of the metric. The tag name
must match the regex `[a-zA-Z_][a-zA-Z0-9_]*` (Ascii alphabet, numbers and
underscore). The tag value may contain any UTF-8 encoded character.
| Constructor and Description |
|---|
MetricID(java.lang.String name)
Constructs a MetricID with the given metric name and no tags.
|
MetricID(java.lang.String name,
Tag... tags)
Constructs a MetricID with the given metric name and
Tags. |
| Modifier and Type | Method and Description |
|---|---|
int |
compareTo(MetricID other)
Compares two MetricID objects through the following steps:
Compares the names of the two MetricIDs lexicographically. |
boolean |
equals(java.lang.Object o) |
java.lang.String |
getName()
Returns the Metric name associated with this MetricID
|
java.util.Map<java.lang.String,java.lang.String> |
getTags()
Returns the underlying map containing the tags.
|
Tag[] |
getTagsAsArray()
Gets the list of tags as an array of
Tag objects. |
java.util.List<Tag> |
getTagsAsList()
Gets the list of tags as a list of
Tag objects |
java.lang.String |
getTagsAsString()
Gets the list of tags as a single String in the format 'key="value",key2="value2",...'
|
int |
hashCode() |
java.lang.String |
toString() |
public MetricID(java.lang.String name)
name - the name of the metricpublic java.lang.String getName()
public java.util.Map<java.lang.String,java.lang.String> getTags()
Map of tagspublic java.lang.String getTagsAsString()
public java.util.List<Tag> getTagsAsList()
Tag objectspublic Tag[] getTagsAsArray()
Tag objects.public boolean equals(java.lang.Object o)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Objectpublic java.lang.String toString()
toString in class java.lang.Objectpublic int compareTo(MetricID other)
compareTo in interface java.lang.Comparable<MetricID>other - the other MetricID