Class MetricDatum
- java.lang.Object
-
- com.amazonaws.services.cloudwatch.model.MetricDatum
-
- All Implemented Interfaces:
Serializable
,Cloneable
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.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description MetricDatum()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method 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(Dimension... dimensions)
A list of dimensions associated with the metric.MetricDatum
withDimensions(Collection<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.
-
-
-
Method Detail
-
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 MetricDatum 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. Note, when using the Dimensions value in a query, you need to append .member.N to it (e.g., Dimensions.member.N).
- Returns:
- 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).
-
setDimensions
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).
- Parameters:
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).
-
withDimensions
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)
orwithDimensions(java.util.Collection)
if you want to override the existing values.- Parameters:
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).- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
withDimensions
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).
- Parameters:
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).- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
setTimestamp
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.
- Parameters:
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.
-
getTimestamp
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.
- Returns:
- 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.
-
withTimestamp
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.
- Parameters:
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.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
setValue
public void setValue(Double value)
The value for the metric.
Although the Value
parameter accepts numbers of typeDouble
, 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.- Parameters:
value
- The value for the metric.Although the Value
parameter accepts numbers of typeDouble
, 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.
-
getValue
public Double getValue()
The value for the metric.
Although the Value
parameter accepts numbers of typeDouble
, 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.- Returns:
- The value for the metric.
Although the Value
parameter accepts numbers of typeDouble
, 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.
-
withValue
public MetricDatum withValue(Double value)
The value for the metric.
Although the Value
parameter accepts numbers of typeDouble
, 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.- Parameters:
value
- The value for the metric.Although the Value
parameter accepts numbers of typeDouble
, 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.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
setStatisticValues
public void setStatisticValues(StatisticSet statisticValues)
A set of statistical values describing the metric.
- Parameters:
statisticValues
- A set of statistical values describing the metric.
-
getStatisticValues
public StatisticSet getStatisticValues()
A set of statistical values describing the metric.
- Returns:
- A set of statistical values describing the metric.
-
withStatisticValues
public MetricDatum withStatisticValues(StatisticSet statisticValues)
A set of statistical values describing the metric.
- Parameters:
statisticValues
- A set of statistical values describing the metric.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
setUnit
public void setUnit(String unit)
The unit of the metric.
- Parameters:
unit
- The unit of the metric.- See Also:
StandardUnit
-
getUnit
public String getUnit()
The unit of the metric.
- Returns:
- The unit of the metric.
- See Also:
StandardUnit
-
withUnit
public MetricDatum withUnit(String unit)
The unit of the metric.
- Parameters:
unit
- The unit of the metric.- Returns:
- Returns a reference to this object so that method calls can be chained together.
- See Also:
StandardUnit
-
setUnit
public void setUnit(StandardUnit unit)
The unit of the metric.
- Parameters:
unit
- The unit of the metric.- See Also:
StandardUnit
-
withUnit
public MetricDatum withUnit(StandardUnit unit)
The unit of the metric.
- Parameters:
unit
- The unit of the metric.- Returns:
- Returns a reference to this object so that method calls can be chained together.
- See Also:
StandardUnit
-
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()
-
clone
public MetricDatum clone()
-
-