public class Metric extends Object implements Serializable, Cloneable
The Metric
data type contains information about a specific
metric. If you call ListMetrics, Amazon CloudWatch returns information
contained by this data type.
The example in the Examples section publishes two metrics named buffers and latency. Both metrics are in the examples namespace. Both metrics have two dimensions, InstanceID and InstanceType.
Constructor and Description |
---|
Metric() |
Modifier and Type | Method and Description |
---|---|
Metric |
clone() |
boolean |
equals(Object obj) |
List<Dimension> |
getDimensions()
A list of dimensions associated with the metric.
|
String |
getMetricName()
The name of the metric.
|
String |
getNamespace()
The namespace of the metric.
|
int |
hashCode() |
void |
setDimensions(Collection<Dimension> dimensions)
A list of dimensions associated with the metric.
|
void |
setMetricName(String metricName)
The name of the metric.
|
void |
setNamespace(String namespace)
The namespace of the metric.
|
String |
toString()
Returns a string representation of this object; useful for testing and
debugging.
|
Metric |
withDimensions(Collection<Dimension> dimensions)
A list of dimensions associated with the metric.
|
Metric |
withDimensions(Dimension... dimensions)
A list of dimensions associated with the metric.
|
Metric |
withMetricName(String metricName)
The name of the metric.
|
Metric |
withNamespace(String namespace)
The namespace of the metric.
|
public void setNamespace(String namespace)
The namespace of the metric.
namespace
- The namespace of the metric.public String getNamespace()
The namespace of the metric.
public Metric withNamespace(String namespace)
The namespace of the metric.
namespace
- The namespace of the metric.public void setMetricName(String metricName)
The name of the metric.
metricName
- The name of the metric.public String getMetricName()
The name of the metric.
public Metric withMetricName(String metricName)
The name of the metric.
metricName
- The name of the metric.public List<Dimension> getDimensions()
A list of dimensions associated with the metric.
public void setDimensions(Collection<Dimension> dimensions)
A list of dimensions associated with the metric.
dimensions
- A list of dimensions associated with the metric.public Metric withDimensions(Dimension... dimensions)
A list of dimensions associated with the metric.
NOTE: This method appends the values to the existing list (if
any). Use setDimensions(java.util.Collection)
or
withDimensions(java.util.Collection)
if you want to override the
existing values.
dimensions
- A list of dimensions associated with the metric.public Metric withDimensions(Collection<Dimension> dimensions)
A list of dimensions associated with the metric.
dimensions
- A list of dimensions associated with the metric.public String toString()
toString
in class Object
Object.toString()
Copyright © 2016. All rights reserved.