public class MetricName extends Object implements Comparable<MetricName>
| Constructor and Description |
|---|
MetricName(String key,
Map<String,String> tags) |
| Modifier and Type | Method and Description |
|---|---|
MetricName |
append(MetricName append)
Build the MetricName that is this with another path and tags appended to it.
|
static MetricName |
build(String... parts)
Build a new metric name using the specific path components.
|
int |
compareTo(MetricName o) |
static MetricName |
empty()
Returns an empty metric name.
|
boolean |
equals(Object o) |
String |
getKey() |
Map<String,String> |
getTags()
Returns the tags, sorted by key.
|
int |
hashCode() |
MetricName |
resolve(String... parts)
Build the MetricName that is this with another path appended to it.
|
MetricName |
tagged(Map<String,String> add)
Add tags to a metric name and return the newly created MetricName.
|
MetricName |
tagged(String... pairs)
Same as
tagged(Map), but takes a variadic list of arguments. |
String |
toString() |
public static MetricName empty()
public String getKey()
public Map<String,String> getTags()
public MetricName resolve(String... parts)
parts - The extra path elements to add to the new metric.public MetricName tagged(Map<String,String> add)
add - Tags to add.public MetricName tagged(String... pairs)
tagged(Map), but takes a variadic list of arguments.pairs - An even list of strings acting as key-value pairs.tagged(Map)public MetricName append(MetricName append)
Semantically equivalent to:
this.resolve(append.getKey()).tagged(append.getTags());
append - The extra name element to add to the new metric.public static MetricName build(String... parts)
Equivalent to:
MetricName.empty().resolve(parts);
parts - Path of the new metric name.public int compareTo(MetricName o)
compareTo in interface Comparable<MetricName>Copyright © 2018. All Rights Reserved.