public class Metric
extends java.lang.Object
implements java.io.Serializable
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 |
---|---|
boolean |
equals(java.lang.Object obj) |
java.util.List<Dimension> |
getDimensions()
A list of dimensions associated with the metric.
|
java.lang.String |
getMetricName()
The name of the metric.
|
java.lang.String |
getNamespace()
The namespace of the metric.
|
int |
hashCode() |
void |
setDimensions(java.util.Collection<Dimension> dimensions)
A list of dimensions associated with the metric.
|
void |
setMetricName(java.lang.String metricName)
The name of the metric.
|
void |
setNamespace(java.lang.String namespace)
The namespace of the metric.
|
java.lang.String |
toString()
Returns a string representation of this object; useful for testing and
debugging.
|
Metric |
withDimensions(java.util.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(java.lang.String metricName)
The name of the metric.
|
Metric |
withNamespace(java.lang.String namespace)
The namespace of the metric.
|
public java.lang.String getNamespace()
The namespace of the metric.
Constraints:
Length: 1 - 255
Pattern: [^:].*
The namespace of the metric.
public void setNamespace(java.lang.String namespace)
The namespace of the metric.
Constraints:
Length: 1 - 255
Pattern: [^:].*
namespace
- The namespace of the metric.
public Metric withNamespace(java.lang.String namespace)
The namespace of the metric.
Returns a reference to this object so that method calls can be chained together.
Constraints:
Length: 1 - 255
Pattern: [^:].*
namespace
- The namespace of the metric.
public java.lang.String getMetricName()
The name of the metric.
Constraints:
Length: 1 - 255
The name of the metric.
public void setMetricName(java.lang.String metricName)
The name of the metric.
Constraints:
Length: 1 - 255
metricName
- The name of the metric.
public Metric withMetricName(java.lang.String metricName)
The name of the metric.
Returns a reference to this object so that method calls can be chained together.
Constraints:
Length: 1 - 255
metricName
- The name of the metric.
public java.util.List<Dimension> getDimensions()
A list of dimensions associated with the metric.
A list of dimensions associated with the metric.
public void setDimensions(java.util.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.
Returns a reference to this object so that method calls can be chained together.
dimensions
- A list of dimensions associated with the metric.
public Metric withDimensions(java.util.Collection<Dimension> dimensions)
A list of dimensions associated with the metric.
Returns a reference to this object so that method calls can be chained together.
dimensions
- A list of dimensions associated with the metric.
public java.lang.String toString()
toString
in class java.lang.Object
Object.toString()
public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
Copyright © 2018 Amazon Web Services, Inc. All Rights Reserved.