com.amazonaws.services.cloudwatch.model
Class GetMetricStatisticsRequest

java.lang.Object
  extended by com.amazonaws.AmazonWebServiceRequest
      extended by com.amazonaws.services.cloudwatch.model.GetMetricStatisticsRequest

public class GetMetricStatisticsRequest
extends AmazonWebServiceRequest

Container for the parameters to the GetMetricStatistics operation.

Gets statistics for the specified metric.

NOTE: The maximum number of data points returned from a single GetMetricStatistics request is 1,440. If a request is made that generates more than 1,440 data points, Amazon CloudWatch returns an error. In such a case, alter the request by narrowing the specified time range or increasing the specified period. Alternatively, make multiple requests across adjacent time ranges.

Amazon CloudWatch aggregates data points based on the length of the period that you specify. For example, if you request statistics with a one-minute granularity, Amazon CloudWatch aggregates data points with time stamps that fall within the same one-minute period. In such a case, the data points queried can greatly outnumber the data points returned.

NOTE: The maximum number of data points that can be queried is 50,850; whereas the maximum number of data points returned is 1,440.

The following examples show various statistics allowed by the data point query maximum of 50,850 when you call GetMetricStatistics on Amazon EC2 instances with detailed (one-minute) monitoring enabled:

See Also:
AmazonCloudWatch.getMetricStatistics(GetMetricStatisticsRequest)

Constructor Summary
GetMetricStatisticsRequest()
           
 
Method Summary
 boolean equals(Object obj)
           
 List<Dimension> getDimensions()
          A list of dimensions describing qualities of the metric.
 Date getEndTime()
          The time stamp to use for determining the last datapoint to return.
 String getMetricName()
          The name of the metric.
 String getNamespace()
          The namespace of the metric.
 Integer getPeriod()
          The granularity, in seconds, of the returned datapoints.
 Date getStartTime()
          The time stamp to use for determining the first datapoint to return.
 List<String> getStatistics()
          The metric statistics to return.
 String getUnit()
          The unit for the metric.
 int hashCode()
           
 void setDimensions(Collection<Dimension> dimensions)
          A list of dimensions describing qualities of the metric.
 void setEndTime(Date endTime)
          The time stamp to use for determining the last datapoint to return.
 void setMetricName(String metricName)
          The name of the metric.
 void setNamespace(String namespace)
          The namespace of the metric.
 void setPeriod(Integer period)
          The granularity, in seconds, of the returned datapoints.
 void setStartTime(Date startTime)
          The time stamp to use for determining the first datapoint to return.
 void setStatistics(Collection<String> statistics)
          The metric statistics to return.
 void setUnit(StandardUnit unit)
          The unit for the metric.
 void setUnit(String unit)
          The unit for the metric.
 String toString()
          Returns a string representation of this object; useful for testing and debugging.
 GetMetricStatisticsRequest withDimensions(Collection<Dimension> dimensions)
          A list of dimensions describing qualities of the metric.
 GetMetricStatisticsRequest withDimensions(Dimension... dimensions)
          A list of dimensions describing qualities of the metric.
 GetMetricStatisticsRequest withEndTime(Date endTime)
          The time stamp to use for determining the last datapoint to return.
 GetMetricStatisticsRequest withMetricName(String metricName)
          The name of the metric.
 GetMetricStatisticsRequest withNamespace(String namespace)
          The namespace of the metric.
 GetMetricStatisticsRequest withPeriod(Integer period)
          The granularity, in seconds, of the returned datapoints.
 GetMetricStatisticsRequest withStartTime(Date startTime)
          The time stamp to use for determining the first datapoint to return.
 GetMetricStatisticsRequest withStatistics(Collection<String> statistics)
          The metric statistics to return.
 GetMetricStatisticsRequest withStatistics(String... statistics)
          The metric statistics to return.
 GetMetricStatisticsRequest withUnit(StandardUnit unit)
          The unit for the metric.
 GetMetricStatisticsRequest withUnit(String unit)
          The unit for the metric.
 
Methods inherited from class com.amazonaws.AmazonWebServiceRequest
copyPrivateRequestParameters, getDelegationToken, getRequestClientOptions, getRequestCredentials, setDelegationToken, setRequestCredentials
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

GetMetricStatisticsRequest

public GetMetricStatisticsRequest()
Method Detail

getNamespace

public String getNamespace()
The namespace of the metric.

Constraints:
Length: 1 - 255
Pattern: [^:].*

Returns:
The namespace of the metric.

setNamespace

public void setNamespace(String namespace)
The namespace of the metric.

Constraints:
Length: 1 - 255
Pattern: [^:].*

Parameters:
namespace - The namespace of the metric.

withNamespace

public GetMetricStatisticsRequest withNamespace(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: [^:].*

Parameters:
namespace - The namespace of the metric.
Returns:
A reference to this updated object so that method calls can be chained together.

getMetricName

public String getMetricName()
The name of the metric.

Constraints:
Length: 1 - 255

Returns:
The name of the metric.

setMetricName

public void setMetricName(String metricName)
The name of the metric.

Constraints:
Length: 1 - 255

Parameters:
metricName - The name of the metric.

withMetricName

public GetMetricStatisticsRequest withMetricName(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

Parameters:
metricName - The name of the metric.
Returns:
A reference to this updated object so that method calls can be chained together.

getDimensions

public List<Dimension> getDimensions()
A list of dimensions describing qualities of the metric.

Constraints:
Length: 0 - 10

Returns:
A list of dimensions describing qualities of the metric.

setDimensions

public void setDimensions(Collection<Dimension> dimensions)
A list of dimensions describing qualities of the metric.

Constraints:
Length: 0 - 10

Parameters:
dimensions - A list of dimensions describing qualities of the metric.

withDimensions

public GetMetricStatisticsRequest withDimensions(Dimension... dimensions)
A list of dimensions describing qualities of the metric.

Returns a reference to this object so that method calls can be chained together.

Constraints:
Length: 0 - 10

Parameters:
dimensions - A list of dimensions describing qualities of the metric.
Returns:
A reference to this updated object so that method calls can be chained together.

withDimensions

public GetMetricStatisticsRequest withDimensions(Collection<Dimension> dimensions)
A list of dimensions describing qualities of the metric.

Returns a reference to this object so that method calls can be chained together.

Constraints:
Length: 0 - 10

Parameters:
dimensions - A list of dimensions describing qualities of the metric.
Returns:
A reference to this updated object so that method calls can be chained together.

getStartTime

public Date getStartTime()
The time stamp to use for determining the first datapoint to return. The value specified is inclusive; results include datapoints with the time stamp specified. The specified start time is rounded down to the nearest value. Datapoints are returned for start times up to two weeks in the past. Specified start times that are more than two weeks in the past will not return datapoints for metrics that are older than two weeks.

Returns:
The time stamp to use for determining the first datapoint to return. The value specified is inclusive; results include datapoints with the time stamp specified. The specified start time is rounded down to the nearest value. Datapoints are returned for start times up to two weeks in the past. Specified start times that are more than two weeks in the past will not return datapoints for metrics that are older than two weeks.

setStartTime

public void setStartTime(Date startTime)
The time stamp to use for determining the first datapoint to return. The value specified is inclusive; results include datapoints with the time stamp specified. The specified start time is rounded down to the nearest value. Datapoints are returned for start times up to two weeks in the past. Specified start times that are more than two weeks in the past will not return datapoints for metrics that are older than two weeks.

Parameters:
startTime - The time stamp to use for determining the first datapoint to return. The value specified is inclusive; results include datapoints with the time stamp specified. The specified start time is rounded down to the nearest value. Datapoints are returned for start times up to two weeks in the past. Specified start times that are more than two weeks in the past will not return datapoints for metrics that are older than two weeks.

withStartTime

public GetMetricStatisticsRequest withStartTime(Date startTime)
The time stamp to use for determining the first datapoint to return. The value specified is inclusive; results include datapoints with the time stamp specified. The specified start time is rounded down to the nearest value. Datapoints are returned for start times up to two weeks in the past. Specified start times that are more than two weeks in the past will not return datapoints for metrics that are older than two weeks.

Returns a reference to this object so that method calls can be chained together.

Parameters:
startTime - The time stamp to use for determining the first datapoint to return. The value specified is inclusive; results include datapoints with the time stamp specified. The specified start time is rounded down to the nearest value. Datapoints are returned for start times up to two weeks in the past. Specified start times that are more than two weeks in the past will not return datapoints for metrics that are older than two weeks.
Returns:
A reference to this updated object so that method calls can be chained together.

getEndTime

public Date getEndTime()
The time stamp to use for determining the last datapoint to return. The value specified is exclusive; results will include datapoints up to the time stamp specified.

Returns:
The time stamp to use for determining the last datapoint to return. The value specified is exclusive; results will include datapoints up to the time stamp specified.

setEndTime

public void setEndTime(Date endTime)
The time stamp to use for determining the last datapoint to return. The value specified is exclusive; results will include datapoints up to the time stamp specified.

Parameters:
endTime - The time stamp to use for determining the last datapoint to return. The value specified is exclusive; results will include datapoints up to the time stamp specified.

withEndTime

public GetMetricStatisticsRequest withEndTime(Date endTime)
The time stamp to use for determining the last datapoint to return. The value specified is exclusive; results will include datapoints up to the time stamp specified.

Returns a reference to this object so that method calls can be chained together.

Parameters:
endTime - The time stamp to use for determining the last datapoint to return. The value specified is exclusive; results will include datapoints up to the time stamp specified.
Returns:
A reference to this updated object so that method calls can be chained together.

getPeriod

public Integer getPeriod()
The granularity, in seconds, of the returned datapoints. Period must be at least 60 seconds and must be a multiple of 60. The default value is 60.

Constraints:
Range: 60 -

Returns:
The granularity, in seconds, of the returned datapoints. Period must be at least 60 seconds and must be a multiple of 60. The default value is 60.

setPeriod

public void setPeriod(Integer period)
The granularity, in seconds, of the returned datapoints. Period must be at least 60 seconds and must be a multiple of 60. The default value is 60.

Constraints:
Range: 60 -

Parameters:
period - The granularity, in seconds, of the returned datapoints. Period must be at least 60 seconds and must be a multiple of 60. The default value is 60.

withPeriod

public GetMetricStatisticsRequest withPeriod(Integer period)
The granularity, in seconds, of the returned datapoints. Period must be at least 60 seconds and must be a multiple of 60. The default value is 60.

Returns a reference to this object so that method calls can be chained together.

Constraints:
Range: 60 -

Parameters:
period - The granularity, in seconds, of the returned datapoints. Period must be at least 60 seconds and must be a multiple of 60. The default value is 60.
Returns:
A reference to this updated object so that method calls can be chained together.

getStatistics

public List<String> getStatistics()
The metric statistics to return.

Constraints:
Length: 1 - 5

Returns:
The metric statistics to return.

setStatistics

public void setStatistics(Collection<String> statistics)
The metric statistics to return.

Constraints:
Length: 1 - 5

Parameters:
statistics - The metric statistics to return.

withStatistics

public GetMetricStatisticsRequest withStatistics(String... statistics)
The metric statistics to return.

Returns a reference to this object so that method calls can be chained together.

Constraints:
Length: 1 - 5

Parameters:
statistics - The metric statistics to return.
Returns:
A reference to this updated object so that method calls can be chained together.

withStatistics

public GetMetricStatisticsRequest withStatistics(Collection<String> statistics)
The metric statistics to return.

Returns a reference to this object so that method calls can be chained together.

Constraints:
Length: 1 - 5

Parameters:
statistics - The metric statistics to return.
Returns:
A reference to this updated object so that method calls can be chained together.

getUnit

public String getUnit()
The unit for the metric.

Constraints:
Allowed Values: Seconds, Microseconds, Milliseconds, Bytes, Kilobytes, Megabytes, Gigabytes, Terabytes, Bits, Kilobits, Megabits, Gigabits, Terabits, Percent, Count, Bytes/Second, Kilobytes/Second, Megabytes/Second, Gigabytes/Second, Terabytes/Second, Bits/Second, Kilobits/Second, Megabits/Second, Gigabits/Second, Terabits/Second, Count/Second, None

Returns:
The unit for the metric.
See Also:
StandardUnit

setUnit

public void setUnit(String unit)
The unit for the metric.

Constraints:
Allowed Values: Seconds, Microseconds, Milliseconds, Bytes, Kilobytes, Megabytes, Gigabytes, Terabytes, Bits, Kilobits, Megabits, Gigabits, Terabits, Percent, Count, Bytes/Second, Kilobytes/Second, Megabytes/Second, Gigabytes/Second, Terabytes/Second, Bits/Second, Kilobits/Second, Megabits/Second, Gigabits/Second, Terabits/Second, Count/Second, None

Parameters:
unit - The unit for the metric.
See Also:
StandardUnit

withUnit

public GetMetricStatisticsRequest withUnit(String unit)
The unit for the metric.

Returns a reference to this object so that method calls can be chained together.

Constraints:
Allowed Values: Seconds, Microseconds, Milliseconds, Bytes, Kilobytes, Megabytes, Gigabytes, Terabytes, Bits, Kilobits, Megabits, Gigabits, Terabits, Percent, Count, Bytes/Second, Kilobytes/Second, Megabytes/Second, Gigabytes/Second, Terabytes/Second, Bits/Second, Kilobits/Second, Megabits/Second, Gigabits/Second, Terabits/Second, Count/Second, None

Parameters:
unit - The unit for the metric.
Returns:
A reference to this updated object so that method calls can be chained together.
See Also:
StandardUnit

setUnit

public void setUnit(StandardUnit unit)
The unit for the metric.

Constraints:
Allowed Values: Seconds, Microseconds, Milliseconds, Bytes, Kilobytes, Megabytes, Gigabytes, Terabytes, Bits, Kilobits, Megabits, Gigabits, Terabits, Percent, Count, Bytes/Second, Kilobytes/Second, Megabytes/Second, Gigabytes/Second, Terabytes/Second, Bits/Second, Kilobits/Second, Megabits/Second, Gigabits/Second, Terabits/Second, Count/Second, None

Parameters:
unit - The unit for the metric.
See Also:
StandardUnit

withUnit

public GetMetricStatisticsRequest withUnit(StandardUnit unit)
The unit for the metric.

Returns a reference to this object so that method calls can be chained together.

Constraints:
Allowed Values: Seconds, Microseconds, Milliseconds, Bytes, Kilobytes, Megabytes, Gigabytes, Terabytes, Bits, Kilobits, Megabits, Gigabits, Terabits, Percent, Count, Bytes/Second, Kilobytes/Second, Megabytes/Second, Gigabytes/Second, Terabytes/Second, Bits/Second, Kilobits/Second, Megabits/Second, Gigabits/Second, Terabits/Second, Count/Second, None

Parameters:
unit - The unit for the metric.
Returns:
A reference to this updated 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 class Object
Returns:
A string representation of this object.
See Also:
Object.toString()

hashCode

public int hashCode()
Overrides:
hashCode in class Object

equals

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


Copyright © 2010 Amazon Web Services, Inc. All Rights Reserved.