public class MetricDatum extends Object implements Serializable, Cloneable
The MetricDatum
data type encapsulates the information sent with
PutMetricData to either create a new metric or add new values to be
aggregated into an existing metric.
Constructor and Description |
---|
MetricDatum() |
Modifier and Type | Method and Description |
---|---|
MetricDatum |
clone() |
boolean |
equals(Object obj) |
List<Dimension> |
getDimensions()
A list of dimensions associated with the metric.
|
String |
getMetricName()
The name of the metric.
|
StatisticSet |
getStatisticValues()
A set of statistical values describing the metric.
|
Date |
getTimestamp()
The time stamp used for the metric in ISO 8601 Universal Coordinated Time
(UTC) format.
|
String |
getUnit()
The unit of the metric.
|
Double |
getValue()
The value for 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 |
setStatisticValues(StatisticSet statisticValues)
A set of statistical values describing the metric.
|
void |
setTimestamp(Date timestamp)
The time stamp used for the metric in ISO 8601 Universal Coordinated Time
(UTC) format.
|
void |
setUnit(StandardUnit unit)
The unit of the metric.
|
void |
setUnit(String unit)
The unit of the metric.
|
void |
setValue(Double value)
The value for the metric.
|
String |
toString()
Returns a string representation of this object; useful for testing and
debugging.
|
MetricDatum |
withDimensions(Collection<Dimension> dimensions)
A list of dimensions associated with the metric.
|
MetricDatum |
withDimensions(Dimension... dimensions)
A list of dimensions associated with the metric.
|
MetricDatum |
withMetricName(String metricName)
The name of the metric.
|
MetricDatum |
withStatisticValues(StatisticSet statisticValues)
A set of statistical values describing the metric.
|
MetricDatum |
withTimestamp(Date timestamp)
The time stamp used for the metric in ISO 8601 Universal Coordinated Time
(UTC) format.
|
MetricDatum |
withUnit(StandardUnit unit)
The unit of the metric.
|
MetricDatum |
withUnit(String unit)
The unit of the metric.
|
MetricDatum |
withValue(Double value)
The value for 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 MetricDatum 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. Note, when using the Dimensions value in a query, you need to append .member.N to it (e.g., Dimensions.member.N).
public void setDimensions(Collection<Dimension> dimensions)
A list of dimensions associated with the metric. Note, when using the Dimensions value in a query, you need to append .member.N to it (e.g., Dimensions.member.N).
dimensions
- A list of dimensions associated with the metric. Note, when using
the Dimensions value in a query, you need to append .member.N to
it (e.g., Dimensions.member.N).public MetricDatum withDimensions(Dimension... dimensions)
A list of dimensions associated with the metric. Note, when using the Dimensions value in a query, you need to append .member.N to it (e.g., Dimensions.member.N).
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. Note, when using
the Dimensions value in a query, you need to append .member.N to
it (e.g., Dimensions.member.N).public MetricDatum withDimensions(Collection<Dimension> dimensions)
A list of dimensions associated with the metric. Note, when using the Dimensions value in a query, you need to append .member.N to it (e.g., Dimensions.member.N).
dimensions
- A list of dimensions associated with the metric. Note, when using
the Dimensions value in a query, you need to append .member.N to
it (e.g., Dimensions.member.N).public void setTimestamp(Date timestamp)
The time stamp used for the metric in ISO 8601 Universal Coordinated Time (UTC) format. If not specified, the default value is set to the time the metric data was received.
timestamp
- The time stamp used for the metric in ISO 8601 Universal
Coordinated Time (UTC) format. If not specified, the default value
is set to the time the metric data was received.public Date getTimestamp()
The time stamp used for the metric in ISO 8601 Universal Coordinated Time (UTC) format. If not specified, the default value is set to the time the metric data was received.
public MetricDatum withTimestamp(Date timestamp)
The time stamp used for the metric in ISO 8601 Universal Coordinated Time (UTC) format. If not specified, the default value is set to the time the metric data was received.
timestamp
- The time stamp used for the metric in ISO 8601 Universal
Coordinated Time (UTC) format. If not specified, the default value
is set to the time the metric data was received.public void setValue(Double value)
The value for the metric.
Value
parameter accepts numbers of
type Double
, Amazon CloudWatch rejects values that are
either too small or too large. Values must be in the range of
8.515920e-109 to 1.174271e+108 (Base 10) or 2e-360 to 2e360 (Base 2). In
addition, special values (e.g., NaN, +Infinity, -Infinity) are not
supported. value
- The value for the metric. Value
parameter accepts numbers of type
Double
, Amazon CloudWatch rejects values that are
either too small or too large. Values must be in the range of
8.515920e-109 to 1.174271e+108 (Base 10) or 2e-360 to 2e360 (Base
2). In addition, special values (e.g., NaN, +Infinity, -Infinity)
are not supported.public Double getValue()
The value for the metric.
Value
parameter accepts numbers of
type Double
, Amazon CloudWatch rejects values that are
either too small or too large. Values must be in the range of
8.515920e-109 to 1.174271e+108 (Base 10) or 2e-360 to 2e360 (Base 2). In
addition, special values (e.g., NaN, +Infinity, -Infinity) are not
supported. Value
parameter accepts numbers of type
Double
, Amazon CloudWatch rejects values that are
either too small or too large. Values must be in the range of
8.515920e-109 to 1.174271e+108 (Base 10) or 2e-360 to 2e360 (Base
2). In addition, special values (e.g., NaN, +Infinity, -Infinity)
are not supported.public MetricDatum withValue(Double value)
The value for the metric.
Value
parameter accepts numbers of
type Double
, Amazon CloudWatch rejects values that are
either too small or too large. Values must be in the range of
8.515920e-109 to 1.174271e+108 (Base 10) or 2e-360 to 2e360 (Base 2). In
addition, special values (e.g., NaN, +Infinity, -Infinity) are not
supported. value
- The value for the metric. Value
parameter accepts numbers of type
Double
, Amazon CloudWatch rejects values that are
either too small or too large. Values must be in the range of
8.515920e-109 to 1.174271e+108 (Base 10) or 2e-360 to 2e360 (Base
2). In addition, special values (e.g., NaN, +Infinity, -Infinity)
are not supported.public void setStatisticValues(StatisticSet statisticValues)
A set of statistical values describing the metric.
statisticValues
- A set of statistical values describing the metric.public StatisticSet getStatisticValues()
A set of statistical values describing the metric.
public MetricDatum withStatisticValues(StatisticSet statisticValues)
A set of statistical values describing the metric.
statisticValues
- A set of statistical values describing the metric.public void setUnit(String unit)
The unit of the metric.
unit
- The unit of the metric.StandardUnit
public String getUnit()
The unit of the metric.
StandardUnit
public MetricDatum withUnit(String unit)
The unit of the metric.
unit
- The unit of the metric.StandardUnit
public void setUnit(StandardUnit unit)
The unit of the metric.
unit
- The unit of the metric.StandardUnit
public MetricDatum withUnit(StandardUnit unit)
The unit of the metric.
unit
- The unit of the metric.StandardUnit
public String toString()
toString
in class Object
Object.toString()
public MetricDatum clone()
Copyright © 2016. All rights reserved.