public class MetricName extends Object implements Comparable<MetricName>
| Modifier and Type | Field and Description |
|---|---|
static MetricName |
EMPTY |
static Map<String,String> |
EMPTY_TAGS |
static String |
SEPARATOR |
| Constructor and Description |
|---|
MetricName() |
MetricName(String key) |
MetricName(String key,
Map<String,String> tags) |
| Modifier and Type | Method and Description |
|---|---|
static MetricName |
build(String... parts)
Build a new metric name using the specific path components.
|
int |
compareTo(MetricName o) |
boolean |
equals(Object obj) |
String |
getKey() |
Map<String,String> |
getTags() |
int |
hashCode() |
static MetricName |
join(MetricName... parts)
Join the specified set of metric names.
|
MetricName |
resolve(String p)
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 final String SEPARATOR
public static final MetricName EMPTY
public MetricName()
public MetricName(String key)
public String getKey()
public MetricName resolve(String p)
p - The extra path element 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 static MetricName join(MetricName... parts)
parts - Multiple metric names to join using the separator.public static MetricName build(String... parts)
parts - Path of the new metric name.public int compareTo(@Nonnull MetricName o)
compareTo in interface Comparable<MetricName>Copyright © 2021. All rights reserved.