public class GetMetricStatisticsRequest extends AmazonWebServiceRequest implements Serializable
GetMetricStatistics operation.
Gets statistics for the specified metric.
The maximum number of data points returned from a single
GetMetricStatistics request is 1,440, wereas the maximum
number of data points that can be queried is 50,850. If you make a
request that generates more than 1,440 data points, Amazon CloudWatch
returns an error. In such a case, you can alter the request by
narrowing the specified time range or increasing the specified period.
Alternatively, you can 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.
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:
For information about the namespace, metric names, and dimensions that other Amazon Web Services products use to send metrics to Cloudwatch, go to Amazon CloudWatch Metrics, Namespaces, and Dimensions Reference in the Amazon CloudWatch Developer Guide .
| Constructor and Description |
|---|
GetMetricStatisticsRequest() |
| Modifier and Type | Method and Description |
|---|---|
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, with or without spaces.
|
String |
getNamespace()
The namespace of the metric, with or without spaces.
|
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, with or without spaces.
|
void |
setNamespace(String namespace)
The namespace of the metric, with or without spaces.
|
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, with or without spaces.
|
GetMetricStatisticsRequest |
withNamespace(String namespace)
The namespace of the metric, with or without spaces.
|
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(Statistic... 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.
|
getRequestClientOptions, getRequestCredentials, getRequestMetricCollector, setRequestCredentials, setRequestMetricCollector, withRequestMetricCollectorpublic String getNamespace()
Constraints:
Length: 1 - 255
Pattern: [^:].*
public void setNamespace(String namespace)
Constraints:
Length: 1 - 255
Pattern: [^:].*
namespace - The namespace of the metric, with or without spaces.public GetMetricStatisticsRequest withNamespace(String namespace)
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, with or without spaces.public String getMetricName()
Constraints:
Length: 1 - 255
public void setMetricName(String metricName)
Constraints:
Length: 1 - 255
metricName - The name of the metric, with or without spaces.public GetMetricStatisticsRequest withMetricName(String metricName)
Returns a reference to this object so that method calls can be chained together.
Constraints:
Length: 1 - 255
metricName - The name of the metric, with or without spaces.public List<Dimension> getDimensions()
Constraints:
Length: 0 - 10
public void setDimensions(Collection<Dimension> dimensions)
Constraints:
Length: 0 - 10
dimensions - A list of dimensions describing qualities of the metric.public GetMetricStatisticsRequest withDimensions(Dimension... dimensions)
Returns a reference to this object so that method calls can be chained together.
Constraints:
Length: 0 - 10
dimensions - A list of dimensions describing qualities of the metric.public GetMetricStatisticsRequest withDimensions(Collection<Dimension> dimensions)
Returns a reference to this object so that method calls can be chained together.
Constraints:
Length: 0 - 10
dimensions - A list of dimensions describing qualities of the metric.public Date getStartTime()
Data that is timestamped 24 hours or more in
the past may take in excess of 48 hours to become available from
submission time using GetMetricStatistics.
Data that is timestamped 24 hours or more in
the past may take in excess of 48 hours to become available from
submission time using GetMetricStatistics.
public void setStartTime(Date startTime)
Data that is timestamped 24 hours or more in
the past may take in excess of 48 hours to become available from
submission time using GetMetricStatistics.
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. Data that is timestamped 24 hours or more in
the past may take in excess of 48 hours to become available from
submission time using GetMetricStatistics.
public GetMetricStatisticsRequest withStartTime(Date startTime)
Data that is timestamped 24 hours or more in
the past may take in excess of 48 hours to become available from
submission time using GetMetricStatistics.
Returns a reference to this object so that method calls can be chained together.
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. Data that is timestamped 24 hours or more in
the past may take in excess of 48 hours to become available from
submission time using GetMetricStatistics.
public Date getEndTime()
public void setEndTime(Date endTime)
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.public GetMetricStatisticsRequest withEndTime(Date endTime)
Returns a reference to this object so that method calls can be chained together.
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.public Integer getPeriod()
Period must be at least 60 seconds and must be a multiple
of 60. The default value is 60.
Constraints:
Range: 60 -
Period must be at least 60 seconds and must be a multiple
of 60. The default value is 60.public void setPeriod(Integer period)
Period must be at least 60 seconds and must be a multiple
of 60. The default value is 60.
Constraints:
Range: 60 -
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.public GetMetricStatisticsRequest withPeriod(Integer period)
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 -
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.public List<String> getStatistics()
Valid Values:
Average | Sum | SampleCount | Maximum | Minimum
Constraints:
Length: 1 - 5
Valid Values:
Average | Sum | SampleCount | Maximum | Minimum
public void setStatistics(Collection<String> statistics)
Valid Values:
Average | Sum | SampleCount | Maximum | Minimum
Constraints:
Length: 1 - 5
statistics - The metric statistics to return. For information about specific
statistics returned by GetMetricStatistics, go to Statistics
in the Amazon CloudWatch Developer Guide. Valid Values:
Average | Sum | SampleCount | Maximum | Minimum
public GetMetricStatisticsRequest withStatistics(String... statistics)
Valid Values:
Average | Sum | SampleCount | Maximum | Minimum
Returns a reference to this object so that method calls can be chained together.
Constraints:
Length: 1 - 5
statistics - The metric statistics to return. For information about specific
statistics returned by GetMetricStatistics, go to Statistics
in the Amazon CloudWatch Developer Guide. Valid Values:
Average | Sum | SampleCount | Maximum | Minimum
public GetMetricStatisticsRequest withStatistics(Collection<String> statistics)
Valid Values:
Average | Sum | SampleCount | Maximum | Minimum
Returns a reference to this object so that method calls can be chained together.
Constraints:
Length: 1 - 5
statistics - The metric statistics to return. For information about specific
statistics returned by GetMetricStatistics, go to Statistics
in the Amazon CloudWatch Developer Guide. Valid Values:
Average | Sum | SampleCount | Maximum | Minimum
public GetMetricStatisticsRequest withStatistics(Statistic... statistics)
Valid Values:
Average | Sum | SampleCount | Maximum | Minimum
Returns a reference to this object so that method calls can be chained together.
Constraints:
Length: 1 - 5
statistics - The metric statistics to return. For information about specific
statistics returned by GetMetricStatistics, go to Statistics
in the Amazon CloudWatch Developer Guide. Valid Values:
Average | Sum | SampleCount | Maximum | Minimum
public String getUnit()
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
StandardUnitpublic void setUnit(String unit)
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
unit - The unit for the metric.StandardUnitpublic GetMetricStatisticsRequest withUnit(String unit)
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
unit - The unit for the metric.StandardUnitpublic void setUnit(StandardUnit unit)
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
unit - The unit for the metric.StandardUnitpublic GetMetricStatisticsRequest withUnit(StandardUnit unit)
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
unit - The unit for the metric.StandardUnitpublic String toString()
toString in class ObjectObject.toString()Copyright © 2016. All rights reserved.