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:
  • Constructor Details

    • MetricDatum

      public MetricDatum()
  • Method Details

    • 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) or withDimensions(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 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.
      Parameters:
      value - The value for the metric.

      Although the 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.
    • getValue

      public Double getValue()

      The value for the metric.

      Although the 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.
      Returns:
      The value for the metric.

      Although the 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.
    • withValue

      public MetricDatum withValue(Double value)

      The value for the metric.

      Although the 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.
      Parameters:
      value - The value for the metric.

      Although the 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.
      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:
    • getUnit

      public String getUnit()

      The unit of the metric.

      Returns:
      The unit of the metric.
      See Also:
    • 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:
    • setUnit

      public void setUnit(StandardUnit unit)

      The unit of the metric.

      Parameters:
      unit - The unit of the metric.
      See Also:
    • 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:
    • toString

      public String toString()
      Returns a string representation of this object; useful for testing and debugging.
      Overrides:
      toString in class Object
      Returns:
      A string representation of this object.
      See Also:
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • clone

      public MetricDatum clone()
      Overrides:
      clone in class Object