public class MetricKey
extends java.lang.Object
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(java.lang.String name,
java.util.Map<java.lang.String,java.lang.String> labels)
Create a MetricsDetails
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object o) |
java.util.Map<java.lang.String,java.lang.String> |
getLabels() |
java.lang.String |
getName() |
int |
hashCode() |
java.lang.String |
toString() |
public MetricKey(java.lang.String name, java.util.Map<java.lang.String,java.lang.String> labels)
name
- metric name. This should be the _converted_ name of the metric (the final name
under which this metric is emitted).labels
- mapping of tag keys to values.public java.lang.String getName()
public java.util.Map<java.lang.String,java.lang.String> getLabels()
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object