com.netflix.servo
Class Metric

java.lang.Object
  extended by com.netflix.servo.Metric

public final class Metric
extends java.lang.Object

Represents a metric value at a given point in time.


Constructor Summary
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.
 
Method Summary
 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()
          
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Metric

public Metric(java.lang.String name,
              TagList tags,
              long timestamp,
              java.lang.Object value)
Creates a new instance.

Parameters:
name - name of the metric
tags - tags associated with the metric
timestamp - point in time when the metric value was sampled
value - value of the metric

Metric

public Metric(MonitorConfig config,
              long timestamp,
              java.lang.Object value)
Creates a new instance.

Parameters:
config - config settings associated with the metric
timestamp - point in time when the metric value was sampled
value - value of the metric
Method Detail

getConfig

public MonitorConfig getConfig()
Returns the config settings associated with the metric.


getTimestamp

public long getTimestamp()
Returns the point in time when the metric was sampled.


getValue

public java.lang.Object getValue()
Returns the value of the metric.


getNumberValue

public java.lang.Number getNumberValue()
Returns the value of the metric as a number.


hasNumberValue

public boolean hasNumberValue()
Returns true if the value for this metric is numeric.


equals

public boolean equals(java.lang.Object obj)

Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()

Overrides:
hashCode in class java.lang.Object

toString

public java.lang.String toString()

Overrides:
toString in class java.lang.Object