public class Metric extends Object
Modifier | Constructor and Description |
---|---|
protected |
Metric(String name) |
protected |
Metric(String name,
String registeredType) |
Modifier and Type | Method and Description |
---|---|
Metric |
addDataPoint(double value)
Adds the data point to the metric with a timestamp of now.
|
Metric |
addDataPoint(long value)
Adds the data point to the metric with a timestamp of now.
|
Metric |
addDataPoint(long timestamp,
double value)
Adds the data point to the metric.
|
Metric |
addDataPoint(long timestamp,
long value)
Adds the data point to the metric.
|
Metric |
addDataPoint(long timestamp,
Object value) |
Metric |
addTag(String name,
String value)
Adds a tag to the data point.
|
Metric |
addTags(Map<String,String> tags)
Adds tags to the data point.
|
List<DataPoint> |
getDataPoints() |
String |
getName()
Returns the metric name.
|
Map<String,String> |
getTags()
Returns the tags associated with the data point.
|
String |
getType()
Returns the custom type name.
|
protected Metric(String name)
public Metric addTag(String name, String value)
name
- tag identifiervalue
- tag valuepublic Metric addTags(Map<String,String> tags)
tags
- map of tagspublic Metric addDataPoint(long timestamp, long value)
timestamp
- when the measurement occurredvalue
- the measurement valuepublic Metric addDataPoint(long value)
value
- the measurement valuepublic Metric addDataPoint(long timestamp, double value)
timestamp
- when the measurement occurredvalue
- the measurement valuepublic Metric addDataPoint(double value)
value
- the measurement valuepublic String getName()
public Map<String,String> getTags()
public String getType()
Copyright © 2014. All rights reserved.