public final class Metric
extends java.lang.Object
Constructor and Description |
---|
Metric(MonitorConfig config,
long timestamp,
java.lang.Object value)
Creates a new instance.
|
Metric(java.lang.String name,
TagList tags,
long timestamp,
java.lang.Object value)
Creates a new instance.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object obj) |
MonitorConfig |
getConfig()
Returns the config settings associated with the metric.
|
java.lang.Number |
getNumberValue()
Returns the value of the metric as a number.
|
long |
getTimestamp()
Returns the point in time when the metric was sampled.
|
java.lang.Object |
getValue()
Returns the value of the metric.
|
int |
hashCode() |
boolean |
hasNumberValue()
Returns true if the value for this metric is numeric.
|
java.lang.String |
toString() |
public Metric(java.lang.String name, TagList tags, long timestamp, java.lang.Object value)
name
- name of the metrictags
- tags associated with the metrictimestamp
- point in time when the metric value was sampledvalue
- value of the metricpublic Metric(MonitorConfig config, long timestamp, java.lang.Object value)
config
- config settings associated with the metrictimestamp
- point in time when the metric value was sampledvalue
- value of the metricpublic MonitorConfig getConfig()
public long getTimestamp()
public java.lang.Object getValue()
public java.lang.Number getNumberValue()
public boolean hasNumberValue()
public boolean equals(java.lang.Object obj)
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