public class MetricKey extends Object implements Keyed
Rather than a Metrics Protobuf, we use objects of this class for filtering Metrics and as entries in the LastValueTracker's underlying Map. We do this because 1) we want to avoid the CPU overhead by filtering metrics before we materialize them 2) the OpenCensus Metric format is not ideal for writing a predicate, since you have to stitch back together the metric labelKeys and labelValues (and this latter one lives inside of an array) and 3) the metric name + labels uniquely identify a metric.
Constructor and Description |
---|
MetricKey(String name,
Map<String,String> labels)
Create a MetricKey
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object o) |
Map<String,String> |
getLabels() |
String |
getName() |
int |
hashCode() |
MetricKey |
key()
This is a bit weird but prevents from always having to wrap this object if we're
already interacting with a MetricKey directly.
|
String |
toString() |
public String getName()