Class Metric
- java.lang.Object
-
- com.amazonaws.services.cloudwatch.model.Metric
-
- All Implemented Interfaces:
Serializable
,Cloneable
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.
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description Metric()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method 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(Dimension... dimensions)
A list of dimensions associated with the metric.Metric
withDimensions(Collection<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.
-
-
-
Method Detail
-
setNamespace
public void setNamespace(String namespace)
The namespace of the metric.
- Parameters:
namespace
- The namespace of the metric.
-
getNamespace
public String getNamespace()
The namespace of the metric.
- Returns:
- The namespace of the metric.
-
withNamespace
public Metric withNamespace(String namespace)
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
public void setMetricName(String metricName)
The name of the metric.
- Parameters:
metricName
- The name of the metric.
-
getMetricName
public String getMetricName()
The name of the metric.
- Returns:
- The name of the metric.
-
withMetricName
public Metric withMetricName(String metricName)
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
public List<Dimension> getDimensions()
A list of dimensions associated with the metric.
- Returns:
- A list of dimensions associated with the metric.
-
setDimensions
public void setDimensions(Collection<Dimension> dimensions)
A list of dimensions associated with the metric.
- Parameters:
dimensions
- A list of dimensions associated with the metric.
-
withDimensions
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)
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
public Metric withDimensions(Collection<Dimension> dimensions)
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
public String toString()
Returns a string representation of this object; useful for testing and debugging.- Overrides:
toString
in classObject
- Returns:
- A string representation of this object.
- See Also:
Object.toString()
-
-