public class GetMetricStatisticsRequest extends AmazonWebServiceRequest implements java.io.Serializable
Gets statistics for the specified metric.
The maximum number of data points that can be queried is 50,850, whereas the
maximum number of data points returned from a single
GetMetricStatistics
request is 1,440. 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. GetMetricStatistics
does
not return the data in chronological order.
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(java.lang.Object obj) |
java.util.List<Dimension> |
getDimensions()
A list of dimensions describing qualities of the metric.
|
java.util.Date |
getEndTime()
The time stamp to use for determining the last datapoint to return.
|
java.lang.String |
getMetricName()
The name of the metric, with or without spaces.
|
java.lang.String |
getNamespace()
The namespace of the metric, with or without spaces.
|
java.lang.Integer |
getPeriod()
The granularity, in seconds, of the returned datapoints.
|
java.util.Date |
getStartTime()
The time stamp to use for determining the first datapoint to return.
|
java.util.List<java.lang.String> |
getStatistics()
The metric statistics to return.
|
java.lang.String |
getUnit()
The unit for the metric.
|
int |
hashCode() |
void |
setDimensions(java.util.Collection<Dimension> dimensions)
A list of dimensions describing qualities of the metric.
|
void |
setEndTime(java.util.Date endTime)
The time stamp to use for determining the last datapoint to return.
|
void |
setMetricName(java.lang.String metricName)
The name of the metric, with or without spaces.
|
void |
setNamespace(java.lang.String namespace)
The namespace of the metric, with or without spaces.
|
void |
setPeriod(java.lang.Integer period)
The granularity, in seconds, of the returned datapoints.
|
void |
setStartTime(java.util.Date startTime)
The time stamp to use for determining the first datapoint to return.
|
void |
setStatistics(java.util.Collection<java.lang.String> statistics)
The metric statistics to return.
|
void |
setUnit(StandardUnit unit)
The unit for the metric.
|
void |
setUnit(java.lang.String unit)
The unit for the metric.
|
java.lang.String |
toString()
Returns a string representation of this object; useful for testing and
debugging.
|
GetMetricStatisticsRequest |
withDimensions(java.util.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(java.util.Date endTime)
The time stamp to use for determining the last datapoint to return.
|
GetMetricStatisticsRequest |
withMetricName(java.lang.String metricName)
The name of the metric, with or without spaces.
|
GetMetricStatisticsRequest |
withNamespace(java.lang.String namespace)
The namespace of the metric, with or without spaces.
|
GetMetricStatisticsRequest |
withPeriod(java.lang.Integer period)
The granularity, in seconds, of the returned datapoints.
|
GetMetricStatisticsRequest |
withStartTime(java.util.Date startTime)
The time stamp to use for determining the first datapoint to return.
|
GetMetricStatisticsRequest |
withStatistics(java.util.Collection<java.lang.String> statistics)
The metric statistics to return.
|
GetMetricStatisticsRequest |
withStatistics(java.lang.String... statistics)
The metric statistics to return.
|
GetMetricStatisticsRequest |
withUnit(StandardUnit unit)
The unit for the metric.
|
GetMetricStatisticsRequest |
withUnit(java.lang.String unit)
The unit for the metric.
|
clone, getCloneRoot, getCloneSource, getGeneralProgressListener, getRequestClientOptions, getRequestCredentials, getRequestMetricCollector, setGeneralProgressListener, setRequestCredentials, setRequestMetricCollector, withGeneralProgressListener, withRequestMetricCollector
public java.lang.String getNamespace()
The namespace of the metric, with or without spaces.
Constraints:
Length: 1 - 255
Pattern: [^:].*
The namespace of the metric, with or without spaces.
public void setNamespace(java.lang.String namespace)
The namespace of the metric, with or without spaces.
Constraints:
Length: 1 - 255
Pattern: [^:].*
namespace
- The namespace of the metric, with or without spaces.
public GetMetricStatisticsRequest withNamespace(java.lang.String namespace)
The namespace of the metric, with or without spaces.
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 java.lang.String getMetricName()
The name of the metric, with or without spaces.
Constraints:
Length: 1 - 255
The name of the metric, with or without spaces.
public void setMetricName(java.lang.String metricName)
The name of the metric, with or without spaces.
Constraints:
Length: 1 - 255
metricName
- The name of the metric, with or without spaces.
public GetMetricStatisticsRequest withMetricName(java.lang.String metricName)
The name of the metric, with or without spaces.
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 java.util.List<Dimension> getDimensions()
A list of dimensions describing qualities of the metric.
A list of dimensions describing qualities of the metric.
public void setDimensions(java.util.Collection<Dimension> dimensions)
A list of dimensions describing qualities of the metric.
dimensions
- A list of dimensions describing qualities of the metric.
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.
dimensions
- A list of dimensions describing qualities of the metric.
public GetMetricStatisticsRequest withDimensions(java.util.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.
dimensions
- A list of dimensions describing qualities of the metric.
public java.util.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 time stamp must be in ISO 8601 UTC format (e.g., 2014-09-03T23:00:00Z).
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
.
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 time stamp must be in ISO 8601 UTC format (e.g., 2014-09-03T23:00:00Z).
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(java.util.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 time stamp must be in ISO 8601 UTC format (e.g., 2014-09-03T23:00:00Z).
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. The time stamp must be in ISO 8601 UTC format (e.g., 2014-09-03T23:00:00Z).
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(java.util.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 time stamp must be in ISO 8601 UTC format (e.g., 2014-09-03T23:00:00Z).
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. The time stamp must be in ISO 8601 UTC format (e.g., 2014-09-03T23:00:00Z).
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 java.util.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. The time stamp must be in ISO 8601 UTC format (e.g., 2014-09-03T23:00:00Z).
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. The time stamp must be in ISO 8601 UTC format (e.g., 2014-09-03T23:00:00Z).
public void setEndTime(java.util.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. The time stamp must be in ISO 8601 UTC format (e.g., 2014-09-03T23:00:00Z).
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. The time stamp must be in ISO 8601 UTC format (e.g., 2014-09-03T23:00:00Z).
public GetMetricStatisticsRequest withEndTime(java.util.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. The time stamp must be in ISO 8601 UTC format (e.g., 2014-09-03T23:00:00Z).
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. The time stamp must be in ISO 8601 UTC format (e.g., 2014-09-03T23:00:00Z).
public java.lang.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 -
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 void setPeriod(java.lang.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 -
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(java.lang.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 -
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 java.util.List<java.lang.String> getStatistics()
The metric statistics to return. For information about specific statistics returned by GetMetricStatistics, see Statistics in the Amazon CloudWatch Developer Guide.
The metric statistics to return. For information about specific statistics returned by GetMetricStatistics, see Statistics in the Amazon CloudWatch Developer Guide.
public void setStatistics(java.util.Collection<java.lang.String> statistics)
The metric statistics to return. For information about specific statistics returned by GetMetricStatistics, see Statistics in the Amazon CloudWatch Developer Guide.
statistics
- The metric statistics to return. For information about specific statistics returned by GetMetricStatistics, see Statistics in the Amazon CloudWatch Developer Guide.
public GetMetricStatisticsRequest withStatistics(java.lang.String... statistics)
The metric statistics to return. For information about specific statistics returned by GetMetricStatistics, see Statistics in the Amazon CloudWatch Developer Guide.
Returns a reference to this object so that method calls can be chained together.
statistics
- The metric statistics to return. For information about specific statistics returned by GetMetricStatistics, see Statistics in the Amazon CloudWatch Developer Guide.
public GetMetricStatisticsRequest withStatistics(java.util.Collection<java.lang.String> statistics)
The metric statistics to return. For information about specific statistics returned by GetMetricStatistics, see Statistics in the Amazon CloudWatch Developer Guide.
Returns a reference to this object so that method calls can be chained together.
statistics
- The metric statistics to return. For information about specific statistics returned by GetMetricStatistics, see Statistics in the Amazon CloudWatch Developer Guide.
public java.lang.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
The unit for the metric.
StandardUnit
public void setUnit(java.lang.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
unit
- The unit for the metric.
StandardUnit
public GetMetricStatisticsRequest withUnit(java.lang.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
unit
- The unit for the metric.
StandardUnit
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
unit
- The unit for the metric.
StandardUnit
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
unit
- The unit for the metric.
StandardUnit
public java.lang.String toString()
toString
in class java.lang.Object
Object.toString()
public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
Copyright © 2018 Amazon Web Services, Inc. All Rights Reserved.