com.amazonaws.services.cloudwatch.model.GetMetricStatisticsRequest Maven / Gradle / Ivy
Show all versions of aws-java-sdk-cloudwatch Show documentation
/*
* Copyright 2019-2024 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
* the License. A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
* CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
* and limitations under the License.
*/
package com.amazonaws.services.cloudwatch.model;
import java.io.Serializable;
import javax.annotation.Generated;
import com.amazonaws.AmazonWebServiceRequest;
/**
*
* @see AWS API
* Documentation
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class GetMetricStatisticsRequest extends com.amazonaws.AmazonWebServiceRequest implements Serializable, Cloneable {
/**
*
* The namespace of the metric, with or without spaces.
*
*/
private String namespace;
/**
*
* The name of the metric, with or without spaces.
*
*/
private String metricName;
/**
*
* The dimensions. If the metric contains multiple dimensions, you must include a value for each dimension.
* CloudWatch treats each unique combination of dimensions as a separate metric. If a specific combination of
* dimensions was not published, you can't retrieve statistics for it. You must specify the same dimensions that
* were used when the metrics were created. For an example, see Dimension Combinations in the Amazon CloudWatch User Guide. For more information about specifying
* dimensions, see Publishing
* Metrics in the Amazon CloudWatch User Guide.
*
*/
private com.amazonaws.internal.SdkInternalList dimensions;
/**
*
* The time stamp that determines the first data point to return. Start times are evaluated relative to the time
* that CloudWatch receives the request.
*
*
* The value specified is inclusive; results include data points with the specified time stamp. In a raw HTTP query,
* the time stamp must be in ISO 8601 UTC format (for example, 2016-10-03T23:00:00Z).
*
*
* CloudWatch rounds the specified time stamp as follows:
*
*
* -
*
* Start time less than 15 days ago - Round down to the nearest whole minute. For example, 12:32:34 is rounded down
* to 12:32:00.
*
*
* -
*
* Start time between 15 and 63 days ago - Round down to the nearest 5-minute clock interval. For example, 12:32:34
* is rounded down to 12:30:00.
*
*
* -
*
* Start time greater than 63 days ago - Round down to the nearest 1-hour clock interval. For example, 12:32:34 is
* rounded down to 12:00:00.
*
*
*
*
* If you set Period
to 5, 10, or 30, the start time of your request is rounded down to the nearest
* time that corresponds to even 5-, 10-, or 30-second divisions of a minute. For example, if you make a query at
* (HH:mm:ss) 01:05:23 for the previous 10-second period, the start time of your request is rounded down and you
* receive data from 01:05:10 to 01:05:20. If you make a query at 15:07:17 for the previous 5 minutes of data, using
* a period of 5 seconds, you receive data timestamped between 15:02:15 and 15:07:15.
*
*/
private java.util.Date startTime;
/**
*
* The time stamp that determines the last data point to return.
*
*
* The value specified is exclusive; results include data points up to the specified time stamp. In a raw HTTP
* query, the time stamp must be in ISO 8601 UTC format (for example, 2016-10-10T23:00:00Z).
*
*/
private java.util.Date endTime;
/**
*
* The granularity, in seconds, of the returned data points. For metrics with regular resolution, a period can be as
* short as one minute (60 seconds) and must be a multiple of 60. For high-resolution metrics that are collected at
* intervals of less than one minute, the period can be 1, 5, 10, 30, 60, or any multiple of 60. High-resolution
* metrics are those metrics stored by a PutMetricData
call that includes a
* StorageResolution
of 1 second.
*
*
* If the StartTime
parameter specifies a time stamp that is greater than 3 hours ago, you must specify
* the period as follows or no data points in that time range is returned:
*
*
* -
*
* Start time between 3 hours and 15 days ago - Use a multiple of 60 seconds (1 minute).
*
*
* -
*
* Start time between 15 and 63 days ago - Use a multiple of 300 seconds (5 minutes).
*
*
* -
*
* Start time greater than 63 days ago - Use a multiple of 3600 seconds (1 hour).
*
*
*
*/
private Integer period;
/**
*
* The metric statistics, other than percentile. For percentile statistics, use ExtendedStatistics
.
* When calling GetMetricStatistics
, you must specify either Statistics
or
* ExtendedStatistics
, but not both.
*
*/
private com.amazonaws.internal.SdkInternalList statistics;
/**
*
* The percentile statistics. Specify values between p0.0 and p100. When calling GetMetricStatistics
,
* you must specify either Statistics
or ExtendedStatistics
, but not both. Percentile
* statistics are not available for metrics when any of the metric values are negative numbers.
*
*/
private com.amazonaws.internal.SdkInternalList extendedStatistics;
/**
*
* The unit for a given metric. If you omit Unit
, all data that was collected with any unit is
* returned, along with the corresponding units that were specified when the data was reported to CloudWatch. If you
* specify a unit, the operation returns only data that was collected with that unit specified. If you specify a
* unit that does not match the data collected, the results of the operation are null. CloudWatch does not perform
* unit conversions.
*
*/
private String unit;
/**
*
* The namespace of the metric, with or without spaces.
*
*
* @param namespace
* The namespace of the metric, with or without spaces.
*/
public void setNamespace(String namespace) {
this.namespace = namespace;
}
/**
*
* The namespace of the metric, with or without spaces.
*
*
* @return The namespace of the metric, with or without spaces.
*/
public String getNamespace() {
return this.namespace;
}
/**
*
* The namespace of the metric, with or without spaces.
*
*
* @param namespace
* The namespace of the metric, with or without spaces.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public GetMetricStatisticsRequest withNamespace(String namespace) {
setNamespace(namespace);
return this;
}
/**
*
* The name of the metric, with or without spaces.
*
*
* @param metricName
* The name of the metric, with or without spaces.
*/
public void setMetricName(String metricName) {
this.metricName = metricName;
}
/**
*
* The name of the metric, with or without spaces.
*
*
* @return The name of the metric, with or without spaces.
*/
public String getMetricName() {
return this.metricName;
}
/**
*
* The name of the metric, with or without spaces.
*
*
* @param metricName
* The name of the metric, with or without spaces.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public GetMetricStatisticsRequest withMetricName(String metricName) {
setMetricName(metricName);
return this;
}
/**
*
* The dimensions. If the metric contains multiple dimensions, you must include a value for each dimension.
* CloudWatch treats each unique combination of dimensions as a separate metric. If a specific combination of
* dimensions was not published, you can't retrieve statistics for it. You must specify the same dimensions that
* were used when the metrics were created. For an example, see Dimension Combinations in the Amazon CloudWatch User Guide. For more information about specifying
* dimensions, see Publishing
* Metrics in the Amazon CloudWatch User Guide.
*
*
* @return The dimensions. If the metric contains multiple dimensions, you must include a value for each dimension.
* CloudWatch treats each unique combination of dimensions as a separate metric. If a specific combination
* of dimensions was not published, you can't retrieve statistics for it. You must specify the same
* dimensions that were used when the metrics were created. For an example, see Dimension Combinations in the Amazon CloudWatch User Guide. For more information about
* specifying dimensions, see Publishing
* Metrics in the Amazon CloudWatch User Guide.
*/
public java.util.List getDimensions() {
if (dimensions == null) {
dimensions = new com.amazonaws.internal.SdkInternalList();
}
return dimensions;
}
/**
*
* The dimensions. If the metric contains multiple dimensions, you must include a value for each dimension.
* CloudWatch treats each unique combination of dimensions as a separate metric. If a specific combination of
* dimensions was not published, you can't retrieve statistics for it. You must specify the same dimensions that
* were used when the metrics were created. For an example, see Dimension Combinations in the Amazon CloudWatch User Guide. For more information about specifying
* dimensions, see Publishing
* Metrics in the Amazon CloudWatch User Guide.
*
*
* @param dimensions
* The dimensions. If the metric contains multiple dimensions, you must include a value for each dimension.
* CloudWatch treats each unique combination of dimensions as a separate metric. If a specific combination of
* dimensions was not published, you can't retrieve statistics for it. You must specify the same dimensions
* that were used when the metrics were created. For an example, see Dimension Combinations in the Amazon CloudWatch User Guide. For more information about
* specifying dimensions, see Publishing
* Metrics in the Amazon CloudWatch User Guide.
*/
public void setDimensions(java.util.Collection dimensions) {
if (dimensions == null) {
this.dimensions = null;
return;
}
this.dimensions = new com.amazonaws.internal.SdkInternalList(dimensions);
}
/**
*
* The dimensions. If the metric contains multiple dimensions, you must include a value for each dimension.
* CloudWatch treats each unique combination of dimensions as a separate metric. If a specific combination of
* dimensions was not published, you can't retrieve statistics for it. You must specify the same dimensions that
* were used when the metrics were created. For an example, see Dimension Combinations in the Amazon CloudWatch User Guide. For more information about specifying
* dimensions, see Publishing
* Metrics in the Amazon CloudWatch User Guide.
*
*
* NOTE: This method appends the values to the existing list (if any). Use
* {@link #setDimensions(java.util.Collection)} or {@link #withDimensions(java.util.Collection)} if you want to
* override the existing values.
*
*
* @param dimensions
* The dimensions. If the metric contains multiple dimensions, you must include a value for each dimension.
* CloudWatch treats each unique combination of dimensions as a separate metric. If a specific combination of
* dimensions was not published, you can't retrieve statistics for it. You must specify the same dimensions
* that were used when the metrics were created. For an example, see Dimension Combinations in the Amazon CloudWatch User Guide. For more information about
* specifying dimensions, see Publishing
* Metrics in the Amazon CloudWatch User Guide.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public GetMetricStatisticsRequest withDimensions(Dimension... dimensions) {
if (this.dimensions == null) {
setDimensions(new com.amazonaws.internal.SdkInternalList(dimensions.length));
}
for (Dimension ele : dimensions) {
this.dimensions.add(ele);
}
return this;
}
/**
*
* The dimensions. If the metric contains multiple dimensions, you must include a value for each dimension.
* CloudWatch treats each unique combination of dimensions as a separate metric. If a specific combination of
* dimensions was not published, you can't retrieve statistics for it. You must specify the same dimensions that
* were used when the metrics were created. For an example, see Dimension Combinations in the Amazon CloudWatch User Guide. For more information about specifying
* dimensions, see Publishing
* Metrics in the Amazon CloudWatch User Guide.
*
*
* @param dimensions
* The dimensions. If the metric contains multiple dimensions, you must include a value for each dimension.
* CloudWatch treats each unique combination of dimensions as a separate metric. If a specific combination of
* dimensions was not published, you can't retrieve statistics for it. You must specify the same dimensions
* that were used when the metrics were created. For an example, see Dimension Combinations in the Amazon CloudWatch User Guide. For more information about
* specifying dimensions, see Publishing
* Metrics in the Amazon CloudWatch User Guide.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public GetMetricStatisticsRequest withDimensions(java.util.Collection dimensions) {
setDimensions(dimensions);
return this;
}
/**
*
* The time stamp that determines the first data point to return. Start times are evaluated relative to the time
* that CloudWatch receives the request.
*
*
* The value specified is inclusive; results include data points with the specified time stamp. In a raw HTTP query,
* the time stamp must be in ISO 8601 UTC format (for example, 2016-10-03T23:00:00Z).
*
*
* CloudWatch rounds the specified time stamp as follows:
*
*
* -
*
* Start time less than 15 days ago - Round down to the nearest whole minute. For example, 12:32:34 is rounded down
* to 12:32:00.
*
*
* -
*
* Start time between 15 and 63 days ago - Round down to the nearest 5-minute clock interval. For example, 12:32:34
* is rounded down to 12:30:00.
*
*
* -
*
* Start time greater than 63 days ago - Round down to the nearest 1-hour clock interval. For example, 12:32:34 is
* rounded down to 12:00:00.
*
*
*
*
* If you set Period
to 5, 10, or 30, the start time of your request is rounded down to the nearest
* time that corresponds to even 5-, 10-, or 30-second divisions of a minute. For example, if you make a query at
* (HH:mm:ss) 01:05:23 for the previous 10-second period, the start time of your request is rounded down and you
* receive data from 01:05:10 to 01:05:20. If you make a query at 15:07:17 for the previous 5 minutes of data, using
* a period of 5 seconds, you receive data timestamped between 15:02:15 and 15:07:15.
*
*
* @param startTime
* The time stamp that determines the first data point to return. Start times are evaluated relative to the
* time that CloudWatch receives the request.
*
* The value specified is inclusive; results include data points with the specified time stamp. In a raw HTTP
* query, the time stamp must be in ISO 8601 UTC format (for example, 2016-10-03T23:00:00Z).
*
*
* CloudWatch rounds the specified time stamp as follows:
*
*
* -
*
* Start time less than 15 days ago - Round down to the nearest whole minute. For example, 12:32:34 is
* rounded down to 12:32:00.
*
*
* -
*
* Start time between 15 and 63 days ago - Round down to the nearest 5-minute clock interval. For example,
* 12:32:34 is rounded down to 12:30:00.
*
*
* -
*
* Start time greater than 63 days ago - Round down to the nearest 1-hour clock interval. For example,
* 12:32:34 is rounded down to 12:00:00.
*
*
*
*
* If you set Period
to 5, 10, or 30, the start time of your request is rounded down to the
* nearest time that corresponds to even 5-, 10-, or 30-second divisions of a minute. For example, if you
* make a query at (HH:mm:ss) 01:05:23 for the previous 10-second period, the start time of your request is
* rounded down and you receive data from 01:05:10 to 01:05:20. If you make a query at 15:07:17 for the
* previous 5 minutes of data, using a period of 5 seconds, you receive data timestamped between 15:02:15 and
* 15:07:15.
*/
public void setStartTime(java.util.Date startTime) {
this.startTime = startTime;
}
/**
*
* The time stamp that determines the first data point to return. Start times are evaluated relative to the time
* that CloudWatch receives the request.
*
*
* The value specified is inclusive; results include data points with the specified time stamp. In a raw HTTP query,
* the time stamp must be in ISO 8601 UTC format (for example, 2016-10-03T23:00:00Z).
*
*
* CloudWatch rounds the specified time stamp as follows:
*
*
* -
*
* Start time less than 15 days ago - Round down to the nearest whole minute. For example, 12:32:34 is rounded down
* to 12:32:00.
*
*
* -
*
* Start time between 15 and 63 days ago - Round down to the nearest 5-minute clock interval. For example, 12:32:34
* is rounded down to 12:30:00.
*
*
* -
*
* Start time greater than 63 days ago - Round down to the nearest 1-hour clock interval. For example, 12:32:34 is
* rounded down to 12:00:00.
*
*
*
*
* If you set Period
to 5, 10, or 30, the start time of your request is rounded down to the nearest
* time that corresponds to even 5-, 10-, or 30-second divisions of a minute. For example, if you make a query at
* (HH:mm:ss) 01:05:23 for the previous 10-second period, the start time of your request is rounded down and you
* receive data from 01:05:10 to 01:05:20. If you make a query at 15:07:17 for the previous 5 minutes of data, using
* a period of 5 seconds, you receive data timestamped between 15:02:15 and 15:07:15.
*
*
* @return The time stamp that determines the first data point to return. Start times are evaluated relative to the
* time that CloudWatch receives the request.
*
* The value specified is inclusive; results include data points with the specified time stamp. In a raw
* HTTP query, the time stamp must be in ISO 8601 UTC format (for example, 2016-10-03T23:00:00Z).
*
*
* CloudWatch rounds the specified time stamp as follows:
*
*
* -
*
* Start time less than 15 days ago - Round down to the nearest whole minute. For example, 12:32:34 is
* rounded down to 12:32:00.
*
*
* -
*
* Start time between 15 and 63 days ago - Round down to the nearest 5-minute clock interval. For example,
* 12:32:34 is rounded down to 12:30:00.
*
*
* -
*
* Start time greater than 63 days ago - Round down to the nearest 1-hour clock interval. For example,
* 12:32:34 is rounded down to 12:00:00.
*
*
*
*
* If you set Period
to 5, 10, or 30, the start time of your request is rounded down to the
* nearest time that corresponds to even 5-, 10-, or 30-second divisions of a minute. For example, if you
* make a query at (HH:mm:ss) 01:05:23 for the previous 10-second period, the start time of your request is
* rounded down and you receive data from 01:05:10 to 01:05:20. If you make a query at 15:07:17 for the
* previous 5 minutes of data, using a period of 5 seconds, you receive data timestamped between 15:02:15
* and 15:07:15.
*/
public java.util.Date getStartTime() {
return this.startTime;
}
/**
*
* The time stamp that determines the first data point to return. Start times are evaluated relative to the time
* that CloudWatch receives the request.
*
*
* The value specified is inclusive; results include data points with the specified time stamp. In a raw HTTP query,
* the time stamp must be in ISO 8601 UTC format (for example, 2016-10-03T23:00:00Z).
*
*
* CloudWatch rounds the specified time stamp as follows:
*
*
* -
*
* Start time less than 15 days ago - Round down to the nearest whole minute. For example, 12:32:34 is rounded down
* to 12:32:00.
*
*
* -
*
* Start time between 15 and 63 days ago - Round down to the nearest 5-minute clock interval. For example, 12:32:34
* is rounded down to 12:30:00.
*
*
* -
*
* Start time greater than 63 days ago - Round down to the nearest 1-hour clock interval. For example, 12:32:34 is
* rounded down to 12:00:00.
*
*
*
*
* If you set Period
to 5, 10, or 30, the start time of your request is rounded down to the nearest
* time that corresponds to even 5-, 10-, or 30-second divisions of a minute. For example, if you make a query at
* (HH:mm:ss) 01:05:23 for the previous 10-second period, the start time of your request is rounded down and you
* receive data from 01:05:10 to 01:05:20. If you make a query at 15:07:17 for the previous 5 minutes of data, using
* a period of 5 seconds, you receive data timestamped between 15:02:15 and 15:07:15.
*
*
* @param startTime
* The time stamp that determines the first data point to return. Start times are evaluated relative to the
* time that CloudWatch receives the request.
*
* The value specified is inclusive; results include data points with the specified time stamp. In a raw HTTP
* query, the time stamp must be in ISO 8601 UTC format (for example, 2016-10-03T23:00:00Z).
*
*
* CloudWatch rounds the specified time stamp as follows:
*
*
* -
*
* Start time less than 15 days ago - Round down to the nearest whole minute. For example, 12:32:34 is
* rounded down to 12:32:00.
*
*
* -
*
* Start time between 15 and 63 days ago - Round down to the nearest 5-minute clock interval. For example,
* 12:32:34 is rounded down to 12:30:00.
*
*
* -
*
* Start time greater than 63 days ago - Round down to the nearest 1-hour clock interval. For example,
* 12:32:34 is rounded down to 12:00:00.
*
*
*
*
* If you set Period
to 5, 10, or 30, the start time of your request is rounded down to the
* nearest time that corresponds to even 5-, 10-, or 30-second divisions of a minute. For example, if you
* make a query at (HH:mm:ss) 01:05:23 for the previous 10-second period, the start time of your request is
* rounded down and you receive data from 01:05:10 to 01:05:20. If you make a query at 15:07:17 for the
* previous 5 minutes of data, using a period of 5 seconds, you receive data timestamped between 15:02:15 and
* 15:07:15.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public GetMetricStatisticsRequest withStartTime(java.util.Date startTime) {
setStartTime(startTime);
return this;
}
/**
*
* The time stamp that determines the last data point to return.
*
*
* The value specified is exclusive; results include data points up to the specified time stamp. In a raw HTTP
* query, the time stamp must be in ISO 8601 UTC format (for example, 2016-10-10T23:00:00Z).
*
*
* @param endTime
* The time stamp that determines the last data point to return.
*
* The value specified is exclusive; results include data points up to the specified time stamp. In a raw
* HTTP query, the time stamp must be in ISO 8601 UTC format (for example, 2016-10-10T23:00:00Z).
*/
public void setEndTime(java.util.Date endTime) {
this.endTime = endTime;
}
/**
*
* The time stamp that determines the last data point to return.
*
*
* The value specified is exclusive; results include data points up to the specified time stamp. In a raw HTTP
* query, the time stamp must be in ISO 8601 UTC format (for example, 2016-10-10T23:00:00Z).
*
*
* @return The time stamp that determines the last data point to return.
*
* The value specified is exclusive; results include data points up to the specified time stamp. In a raw
* HTTP query, the time stamp must be in ISO 8601 UTC format (for example, 2016-10-10T23:00:00Z).
*/
public java.util.Date getEndTime() {
return this.endTime;
}
/**
*
* The time stamp that determines the last data point to return.
*
*
* The value specified is exclusive; results include data points up to the specified time stamp. In a raw HTTP
* query, the time stamp must be in ISO 8601 UTC format (for example, 2016-10-10T23:00:00Z).
*
*
* @param endTime
* The time stamp that determines the last data point to return.
*
* The value specified is exclusive; results include data points up to the specified time stamp. In a raw
* HTTP query, the time stamp must be in ISO 8601 UTC format (for example, 2016-10-10T23:00:00Z).
* @return Returns a reference to this object so that method calls can be chained together.
*/
public GetMetricStatisticsRequest withEndTime(java.util.Date endTime) {
setEndTime(endTime);
return this;
}
/**
*
* The granularity, in seconds, of the returned data points. For metrics with regular resolution, a period can be as
* short as one minute (60 seconds) and must be a multiple of 60. For high-resolution metrics that are collected at
* intervals of less than one minute, the period can be 1, 5, 10, 30, 60, or any multiple of 60. High-resolution
* metrics are those metrics stored by a PutMetricData
call that includes a
* StorageResolution
of 1 second.
*
*
* If the StartTime
parameter specifies a time stamp that is greater than 3 hours ago, you must specify
* the period as follows or no data points in that time range is returned:
*
*
* -
*
* Start time between 3 hours and 15 days ago - Use a multiple of 60 seconds (1 minute).
*
*
* -
*
* Start time between 15 and 63 days ago - Use a multiple of 300 seconds (5 minutes).
*
*
* -
*
* Start time greater than 63 days ago - Use a multiple of 3600 seconds (1 hour).
*
*
*
*
* @param period
* The granularity, in seconds, of the returned data points. For metrics with regular resolution, a period
* can be as short as one minute (60 seconds) and must be a multiple of 60. For high-resolution metrics that
* are collected at intervals of less than one minute, the period can be 1, 5, 10, 30, 60, or any multiple of
* 60. High-resolution metrics are those metrics stored by a PutMetricData
call that includes a
* StorageResolution
of 1 second.
*
* If the StartTime
parameter specifies a time stamp that is greater than 3 hours ago, you must
* specify the period as follows or no data points in that time range is returned:
*
*
* -
*
* Start time between 3 hours and 15 days ago - Use a multiple of 60 seconds (1 minute).
*
*
* -
*
* Start time between 15 and 63 days ago - Use a multiple of 300 seconds (5 minutes).
*
*
* -
*
* Start time greater than 63 days ago - Use a multiple of 3600 seconds (1 hour).
*
*
*/
public void setPeriod(Integer period) {
this.period = period;
}
/**
*
* The granularity, in seconds, of the returned data points. For metrics with regular resolution, a period can be as
* short as one minute (60 seconds) and must be a multiple of 60. For high-resolution metrics that are collected at
* intervals of less than one minute, the period can be 1, 5, 10, 30, 60, or any multiple of 60. High-resolution
* metrics are those metrics stored by a PutMetricData
call that includes a
* StorageResolution
of 1 second.
*
*
* If the StartTime
parameter specifies a time stamp that is greater than 3 hours ago, you must specify
* the period as follows or no data points in that time range is returned:
*
*
* -
*
* Start time between 3 hours and 15 days ago - Use a multiple of 60 seconds (1 minute).
*
*
* -
*
* Start time between 15 and 63 days ago - Use a multiple of 300 seconds (5 minutes).
*
*
* -
*
* Start time greater than 63 days ago - Use a multiple of 3600 seconds (1 hour).
*
*
*
*
* @return The granularity, in seconds, of the returned data points. For metrics with regular resolution, a period
* can be as short as one minute (60 seconds) and must be a multiple of 60. For high-resolution metrics that
* are collected at intervals of less than one minute, the period can be 1, 5, 10, 30, 60, or any multiple
* of 60. High-resolution metrics are those metrics stored by a PutMetricData
call that
* includes a StorageResolution
of 1 second.
*
* If the StartTime
parameter specifies a time stamp that is greater than 3 hours ago, you must
* specify the period as follows or no data points in that time range is returned:
*
*
* -
*
* Start time between 3 hours and 15 days ago - Use a multiple of 60 seconds (1 minute).
*
*
* -
*
* Start time between 15 and 63 days ago - Use a multiple of 300 seconds (5 minutes).
*
*
* -
*
* Start time greater than 63 days ago - Use a multiple of 3600 seconds (1 hour).
*
*
*/
public Integer getPeriod() {
return this.period;
}
/**
*
* The granularity, in seconds, of the returned data points. For metrics with regular resolution, a period can be as
* short as one minute (60 seconds) and must be a multiple of 60. For high-resolution metrics that are collected at
* intervals of less than one minute, the period can be 1, 5, 10, 30, 60, or any multiple of 60. High-resolution
* metrics are those metrics stored by a PutMetricData
call that includes a
* StorageResolution
of 1 second.
*
*
* If the StartTime
parameter specifies a time stamp that is greater than 3 hours ago, you must specify
* the period as follows or no data points in that time range is returned:
*
*
* -
*
* Start time between 3 hours and 15 days ago - Use a multiple of 60 seconds (1 minute).
*
*
* -
*
* Start time between 15 and 63 days ago - Use a multiple of 300 seconds (5 minutes).
*
*
* -
*
* Start time greater than 63 days ago - Use a multiple of 3600 seconds (1 hour).
*
*
*
*
* @param period
* The granularity, in seconds, of the returned data points. For metrics with regular resolution, a period
* can be as short as one minute (60 seconds) and must be a multiple of 60. For high-resolution metrics that
* are collected at intervals of less than one minute, the period can be 1, 5, 10, 30, 60, or any multiple of
* 60. High-resolution metrics are those metrics stored by a PutMetricData
call that includes a
* StorageResolution
of 1 second.
*
* If the StartTime
parameter specifies a time stamp that is greater than 3 hours ago, you must
* specify the period as follows or no data points in that time range is returned:
*
*
* -
*
* Start time between 3 hours and 15 days ago - Use a multiple of 60 seconds (1 minute).
*
*
* -
*
* Start time between 15 and 63 days ago - Use a multiple of 300 seconds (5 minutes).
*
*
* -
*
* Start time greater than 63 days ago - Use a multiple of 3600 seconds (1 hour).
*
*
* @return Returns a reference to this object so that method calls can be chained together.
*/
public GetMetricStatisticsRequest withPeriod(Integer period) {
setPeriod(period);
return this;
}
/**
*
* The metric statistics, other than percentile. For percentile statistics, use ExtendedStatistics
.
* When calling GetMetricStatistics
, you must specify either Statistics
or
* ExtendedStatistics
, but not both.
*
*
* @return The metric statistics, other than percentile. For percentile statistics, use
* ExtendedStatistics
. When calling GetMetricStatistics
, you must specify either
* Statistics
or ExtendedStatistics
, but not both.
* @see Statistic
*/
public java.util.List getStatistics() {
if (statistics == null) {
statistics = new com.amazonaws.internal.SdkInternalList();
}
return statistics;
}
/**
*
* The metric statistics, other than percentile. For percentile statistics, use ExtendedStatistics
.
* When calling GetMetricStatistics
, you must specify either Statistics
or
* ExtendedStatistics
, but not both.
*
*
* @param statistics
* The metric statistics, other than percentile. For percentile statistics, use
* ExtendedStatistics
. When calling GetMetricStatistics
, you must specify either
* Statistics
or ExtendedStatistics
, but not both.
* @see Statistic
*/
public void setStatistics(java.util.Collection statistics) {
if (statistics == null) {
this.statistics = null;
return;
}
this.statistics = new com.amazonaws.internal.SdkInternalList(statistics);
}
/**
*
* The metric statistics, other than percentile. For percentile statistics, use ExtendedStatistics
.
* When calling GetMetricStatistics
, you must specify either Statistics
or
* ExtendedStatistics
, but not both.
*
*
* NOTE: This method appends the values to the existing list (if any). Use
* {@link #setStatistics(java.util.Collection)} or {@link #withStatistics(java.util.Collection)} if you want to
* override the existing values.
*
*
* @param statistics
* The metric statistics, other than percentile. For percentile statistics, use
* ExtendedStatistics
. When calling GetMetricStatistics
, you must specify either
* Statistics
or ExtendedStatistics
, but not both.
* @return Returns a reference to this object so that method calls can be chained together.
* @see Statistic
*/
public GetMetricStatisticsRequest withStatistics(String... statistics) {
if (this.statistics == null) {
setStatistics(new com.amazonaws.internal.SdkInternalList(statistics.length));
}
for (String ele : statistics) {
this.statistics.add(ele);
}
return this;
}
/**
*
* The metric statistics, other than percentile. For percentile statistics, use ExtendedStatistics
.
* When calling GetMetricStatistics
, you must specify either Statistics
or
* ExtendedStatistics
, but not both.
*
*
* @param statistics
* The metric statistics, other than percentile. For percentile statistics, use
* ExtendedStatistics
. When calling GetMetricStatistics
, you must specify either
* Statistics
or ExtendedStatistics
, but not both.
* @return Returns a reference to this object so that method calls can be chained together.
* @see Statistic
*/
public GetMetricStatisticsRequest withStatistics(java.util.Collection statistics) {
setStatistics(statistics);
return this;
}
/**
*
* The metric statistics, other than percentile. For percentile statistics, use ExtendedStatistics
.
* When calling GetMetricStatistics
, you must specify either Statistics
or
* ExtendedStatistics
, but not both.
*
*
* @param statistics
* The metric statistics, other than percentile. For percentile statistics, use
* ExtendedStatistics
. When calling GetMetricStatistics
, you must specify either
* Statistics
or ExtendedStatistics
, but not both.
* @return Returns a reference to this object so that method calls can be chained together.
* @see Statistic
*/
public GetMetricStatisticsRequest withStatistics(Statistic... statistics) {
com.amazonaws.internal.SdkInternalList statisticsCopy = new com.amazonaws.internal.SdkInternalList(statistics.length);
for (Statistic value : statistics) {
statisticsCopy.add(value.toString());
}
if (getStatistics() == null) {
setStatistics(statisticsCopy);
} else {
getStatistics().addAll(statisticsCopy);
}
return this;
}
/**
*
* The percentile statistics. Specify values between p0.0 and p100. When calling GetMetricStatistics
,
* you must specify either Statistics
or ExtendedStatistics
, but not both. Percentile
* statistics are not available for metrics when any of the metric values are negative numbers.
*
*
* @return The percentile statistics. Specify values between p0.0 and p100. When calling
* GetMetricStatistics
, you must specify either Statistics
or
* ExtendedStatistics
, but not both. Percentile statistics are not available for metrics when
* any of the metric values are negative numbers.
*/
public java.util.List getExtendedStatistics() {
if (extendedStatistics == null) {
extendedStatistics = new com.amazonaws.internal.SdkInternalList();
}
return extendedStatistics;
}
/**
*
* The percentile statistics. Specify values between p0.0 and p100. When calling GetMetricStatistics
,
* you must specify either Statistics
or ExtendedStatistics
, but not both. Percentile
* statistics are not available for metrics when any of the metric values are negative numbers.
*
*
* @param extendedStatistics
* The percentile statistics. Specify values between p0.0 and p100. When calling
* GetMetricStatistics
, you must specify either Statistics
or
* ExtendedStatistics
, but not both. Percentile statistics are not available for metrics when
* any of the metric values are negative numbers.
*/
public void setExtendedStatistics(java.util.Collection extendedStatistics) {
if (extendedStatistics == null) {
this.extendedStatistics = null;
return;
}
this.extendedStatistics = new com.amazonaws.internal.SdkInternalList(extendedStatistics);
}
/**
*
* The percentile statistics. Specify values between p0.0 and p100. When calling GetMetricStatistics
,
* you must specify either Statistics
or ExtendedStatistics
, but not both. Percentile
* statistics are not available for metrics when any of the metric values are negative numbers.
*
*
* NOTE: This method appends the values to the existing list (if any). Use
* {@link #setExtendedStatistics(java.util.Collection)} or {@link #withExtendedStatistics(java.util.Collection)} if
* you want to override the existing values.
*
*
* @param extendedStatistics
* The percentile statistics. Specify values between p0.0 and p100. When calling
* GetMetricStatistics
, you must specify either Statistics
or
* ExtendedStatistics
, but not both. Percentile statistics are not available for metrics when
* any of the metric values are negative numbers.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public GetMetricStatisticsRequest withExtendedStatistics(String... extendedStatistics) {
if (this.extendedStatistics == null) {
setExtendedStatistics(new com.amazonaws.internal.SdkInternalList(extendedStatistics.length));
}
for (String ele : extendedStatistics) {
this.extendedStatistics.add(ele);
}
return this;
}
/**
*
* The percentile statistics. Specify values between p0.0 and p100. When calling GetMetricStatistics
,
* you must specify either Statistics
or ExtendedStatistics
, but not both. Percentile
* statistics are not available for metrics when any of the metric values are negative numbers.
*
*
* @param extendedStatistics
* The percentile statistics. Specify values between p0.0 and p100. When calling
* GetMetricStatistics
, you must specify either Statistics
or
* ExtendedStatistics
, but not both. Percentile statistics are not available for metrics when
* any of the metric values are negative numbers.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public GetMetricStatisticsRequest withExtendedStatistics(java.util.Collection extendedStatistics) {
setExtendedStatistics(extendedStatistics);
return this;
}
/**
*
* The unit for a given metric. If you omit Unit
, all data that was collected with any unit is
* returned, along with the corresponding units that were specified when the data was reported to CloudWatch. If you
* specify a unit, the operation returns only data that was collected with that unit specified. If you specify a
* unit that does not match the data collected, the results of the operation are null. CloudWatch does not perform
* unit conversions.
*
*
* @param unit
* The unit for a given metric. If you omit Unit
, all data that was collected with any unit is
* returned, along with the corresponding units that were specified when the data was reported to CloudWatch.
* If you specify a unit, the operation returns only data that was collected with that unit specified. If you
* specify a unit that does not match the data collected, the results of the operation are null. CloudWatch
* does not perform unit conversions.
* @see StandardUnit
*/
public void setUnit(String unit) {
this.unit = unit;
}
/**
*
* The unit for a given metric. If you omit Unit
, all data that was collected with any unit is
* returned, along with the corresponding units that were specified when the data was reported to CloudWatch. If you
* specify a unit, the operation returns only data that was collected with that unit specified. If you specify a
* unit that does not match the data collected, the results of the operation are null. CloudWatch does not perform
* unit conversions.
*
*
* @return The unit for a given metric. If you omit Unit
, all data that was collected with any unit is
* returned, along with the corresponding units that were specified when the data was reported to
* CloudWatch. If you specify a unit, the operation returns only data that was collected with that unit
* specified. If you specify a unit that does not match the data collected, the results of the operation are
* null. CloudWatch does not perform unit conversions.
* @see StandardUnit
*/
public String getUnit() {
return this.unit;
}
/**
*
* The unit for a given metric. If you omit Unit
, all data that was collected with any unit is
* returned, along with the corresponding units that were specified when the data was reported to CloudWatch. If you
* specify a unit, the operation returns only data that was collected with that unit specified. If you specify a
* unit that does not match the data collected, the results of the operation are null. CloudWatch does not perform
* unit conversions.
*
*
* @param unit
* The unit for a given metric. If you omit Unit
, all data that was collected with any unit is
* returned, along with the corresponding units that were specified when the data was reported to CloudWatch.
* If you specify a unit, the operation returns only data that was collected with that unit specified. If you
* specify a unit that does not match the data collected, the results of the operation are null. CloudWatch
* does not perform unit conversions.
* @return Returns a reference to this object so that method calls can be chained together.
* @see StandardUnit
*/
public GetMetricStatisticsRequest withUnit(String unit) {
setUnit(unit);
return this;
}
/**
*
* The unit for a given metric. If you omit Unit
, all data that was collected with any unit is
* returned, along with the corresponding units that were specified when the data was reported to CloudWatch. If you
* specify a unit, the operation returns only data that was collected with that unit specified. If you specify a
* unit that does not match the data collected, the results of the operation are null. CloudWatch does not perform
* unit conversions.
*
*
* @param unit
* The unit for a given metric. If you omit Unit
, all data that was collected with any unit is
* returned, along with the corresponding units that were specified when the data was reported to CloudWatch.
* If you specify a unit, the operation returns only data that was collected with that unit specified. If you
* specify a unit that does not match the data collected, the results of the operation are null. CloudWatch
* does not perform unit conversions.
* @see StandardUnit
*/
public void setUnit(StandardUnit unit) {
withUnit(unit);
}
/**
*
* The unit for a given metric. If you omit Unit
, all data that was collected with any unit is
* returned, along with the corresponding units that were specified when the data was reported to CloudWatch. If you
* specify a unit, the operation returns only data that was collected with that unit specified. If you specify a
* unit that does not match the data collected, the results of the operation are null. CloudWatch does not perform
* unit conversions.
*
*
* @param unit
* The unit for a given metric. If you omit Unit
, all data that was collected with any unit is
* returned, along with the corresponding units that were specified when the data was reported to CloudWatch.
* If you specify a unit, the operation returns only data that was collected with that unit specified. If you
* specify a unit that does not match the data collected, the results of the operation are null. CloudWatch
* does not perform unit conversions.
* @return Returns a reference to this object so that method calls can be chained together.
* @see StandardUnit
*/
public GetMetricStatisticsRequest withUnit(StandardUnit unit) {
this.unit = unit.toString();
return this;
}
/**
* Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be
* redacted from this string using a placeholder value.
*
* @return A string representation of this object.
*
* @see java.lang.Object#toString()
*/
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("{");
if (getNamespace() != null)
sb.append("Namespace: ").append(getNamespace()).append(",");
if (getMetricName() != null)
sb.append("MetricName: ").append(getMetricName()).append(",");
if (getDimensions() != null)
sb.append("Dimensions: ").append(getDimensions()).append(",");
if (getStartTime() != null)
sb.append("StartTime: ").append(getStartTime()).append(",");
if (getEndTime() != null)
sb.append("EndTime: ").append(getEndTime()).append(",");
if (getPeriod() != null)
sb.append("Period: ").append(getPeriod()).append(",");
if (getStatistics() != null)
sb.append("Statistics: ").append(getStatistics()).append(",");
if (getExtendedStatistics() != null)
sb.append("ExtendedStatistics: ").append(getExtendedStatistics()).append(",");
if (getUnit() != null)
sb.append("Unit: ").append(getUnit());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof GetMetricStatisticsRequest == false)
return false;
GetMetricStatisticsRequest other = (GetMetricStatisticsRequest) obj;
if (other.getNamespace() == null ^ this.getNamespace() == null)
return false;
if (other.getNamespace() != null && other.getNamespace().equals(this.getNamespace()) == false)
return false;
if (other.getMetricName() == null ^ this.getMetricName() == null)
return false;
if (other.getMetricName() != null && other.getMetricName().equals(this.getMetricName()) == false)
return false;
if (other.getDimensions() == null ^ this.getDimensions() == null)
return false;
if (other.getDimensions() != null && other.getDimensions().equals(this.getDimensions()) == false)
return false;
if (other.getStartTime() == null ^ this.getStartTime() == null)
return false;
if (other.getStartTime() != null && other.getStartTime().equals(this.getStartTime()) == false)
return false;
if (other.getEndTime() == null ^ this.getEndTime() == null)
return false;
if (other.getEndTime() != null && other.getEndTime().equals(this.getEndTime()) == false)
return false;
if (other.getPeriod() == null ^ this.getPeriod() == null)
return false;
if (other.getPeriod() != null && other.getPeriod().equals(this.getPeriod()) == false)
return false;
if (other.getStatistics() == null ^ this.getStatistics() == null)
return false;
if (other.getStatistics() != null && other.getStatistics().equals(this.getStatistics()) == false)
return false;
if (other.getExtendedStatistics() == null ^ this.getExtendedStatistics() == null)
return false;
if (other.getExtendedStatistics() != null && other.getExtendedStatistics().equals(this.getExtendedStatistics()) == false)
return false;
if (other.getUnit() == null ^ this.getUnit() == null)
return false;
if (other.getUnit() != null && other.getUnit().equals(this.getUnit()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getNamespace() == null) ? 0 : getNamespace().hashCode());
hashCode = prime * hashCode + ((getMetricName() == null) ? 0 : getMetricName().hashCode());
hashCode = prime * hashCode + ((getDimensions() == null) ? 0 : getDimensions().hashCode());
hashCode = prime * hashCode + ((getStartTime() == null) ? 0 : getStartTime().hashCode());
hashCode = prime * hashCode + ((getEndTime() == null) ? 0 : getEndTime().hashCode());
hashCode = prime * hashCode + ((getPeriod() == null) ? 0 : getPeriod().hashCode());
hashCode = prime * hashCode + ((getStatistics() == null) ? 0 : getStatistics().hashCode());
hashCode = prime * hashCode + ((getExtendedStatistics() == null) ? 0 : getExtendedStatistics().hashCode());
hashCode = prime * hashCode + ((getUnit() == null) ? 0 : getUnit().hashCode());
return hashCode;
}
@Override
public GetMetricStatisticsRequest clone() {
return (GetMetricStatisticsRequest) super.clone();
}
}