Class Metric
- All Implemented Interfaces:
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.
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionclone()booleanA list of dimensions associated with the metric.The name of the metric.The namespace of the metric.inthashCode()voidsetDimensions(Collection<Dimension> dimensions) A list of dimensions associated with the metric.voidsetMetricName(String metricName) The name of the metric.voidsetNamespace(String namespace) The namespace of the metric.toString()Returns a string representation of this object; useful for testing and debugging.withDimensions(Dimension... dimensions) A list of dimensions associated with the metric.withDimensions(Collection<Dimension> dimensions) A list of dimensions associated with the metric.withMetricName(String metricName) The name of the metric.withNamespace(String namespace) The namespace of the metric.
-
Constructor Details
-
Metric
public Metric()
-
-
Method Details
-
setNamespace
The namespace of the metric.
- Parameters:
namespace- The namespace of the metric.
-
getNamespace
-
withNamespace
-
setMetricName
The name of the metric.
- Parameters:
metricName- The name of the metric.
-
getMetricName
-
withMetricName
-
getDimensions
-
setDimensions
A list of dimensions associated with the metric.
- Parameters:
dimensions- A list of dimensions associated with the metric.
-
withDimensions
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)orwithDimensions(java.util.Collection)if you want to override the existing values.- Parameters:
dimensions- A list of dimensions associated with the metric.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
withDimensions
A list of dimensions associated with the metric.
- Parameters:
dimensions- A list of dimensions associated with the metric.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
toString
-
equals
-
hashCode
-
clone
-