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()
boolean
A list of dimensions associated with the metric.The name of the metric.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.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
The namespace of the metric.
- Returns:
- The namespace of the metric.
-
withNamespace
The namespace of the metric.
- Parameters:
namespace
- The namespace of the metric.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
setMetricName
The name of the metric.
- Parameters:
metricName
- The name of the metric.
-
getMetricName
The name of the metric.
- Returns:
- The name of the metric.
-
withMetricName
The name of the metric.
- Parameters:
metricName
- The name of the metric.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
getDimensions
A list of dimensions associated with the metric.
- Returns:
- A list of dimensions associated with the metric.
-
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
Returns a string representation of this object; useful for testing and debugging. -
equals
-
hashCode
public int hashCode() -
clone
-