@SdkInternalApi
    final GetMetricStatisticsResult executeGetMetricStatistics(GetMetricStatisticsRequest getMetricStatisticsRequest) {

        ExecutionContext executionContext = createExecutionContext(getMetricStatisticsRequest);
        AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
        awsRequestMetrics.startEvent(Field.ClientExecuteTime);
        Request<GetMetricStatisticsRequest> request = null;
        Response<GetMetricStatisticsResult> response = null;

        try {
            awsRequestMetrics.startEvent(Field.RequestMarshallTime);
            try {
                request = new GetMetricStatisticsRequestMarshaller().marshall(super.beforeMarshalling(getMetricStatisticsRequest));
                // Binds the request metrics to the current request.
                request.setAWSRequestMetrics(awsRequestMetrics);
                request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);
                request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());
                request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
                request.addHandlerContext(HandlerContextKey.SERVICE_ID, "CloudWatch");
                request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "GetMetricStatistics");
                request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);

            } finally {
                awsRequestMetrics.endEvent(Field.RequestMarshallTime);
            }

            StaxResponseHandler<GetMetricStatisticsResult> responseHandler = new StaxResponseHandler<GetMetricStatisticsResult>(
                    new GetMetricStatisticsResultStaxUnmarshaller());

            response = invoke(request, responseHandler, executionContext);

            return response.getAwsResponse();

        } finally {

            endClientExecution(awsRequestMetrics, request, response);
        }
    }
<p>
Gets statistics for the specified metric.
</p>
<p>
The maximum number of data points returned from a single call is 1,440. If you request more than 1,440 data
points, CloudWatch returns an error. To reduce the number of data points, you can narrow the specified time range
and make multiple requests across adjacent time ranges, or you can increase the specified period. Data points are
not returned in chronological order.
</p>
<p>
CloudWatch aggregates data points based on the length of the period that you specify. For example, if you request
statistics with a one-hour period, CloudWatch aggregates all data points with time stamps that fall within each
one-hour period. Therefore, the number of values aggregated by CloudWatch is larger than the number of data
points returned.
</p>
<p>
CloudWatch needs raw data points to calculate percentile statistics. If you publish data using a statistic set
instead, you can only retrieve percentile statistics for this data if one of the following conditions is true:
</p>
<ul>
<li>
<p>
The SampleCount value of the statistic set is 1.
</p>
</li>
<li>
<p>
The Min and the Max values of the statistic set are equal.
</p>
</li>
</ul>
<p>
Percentile statistics are not available for metrics when any of the metric values are negative numbers.
</p>
<p>
Amazon CloudWatch retains metric data as follows:
</p>
<ul>
<li>
<p>
Data points with a period of less than 60 seconds are available for 3 hours. These data points are
high-resolution metrics and are available only for custom metrics that have been defined with a
<code>StorageResolution</code> of 1.
</p>
</li>
<li>
<p>
Data points with a period of 60 seconds (1-minute) are available for 15 days.
</p>
</li>
<li>
<p>
Data points with a period of 300 seconds (5-minute) are available for 63 days.
</p>
</li>
<li>
<p>
Data points with a period of 3600 seconds (1 hour) are available for 455 days (15 months).
</p>
</li>
</ul>
<p>
Data points that are initially published with a shorter period are aggregated together for long-term storage. For
example, if you collect data using a period of 1 minute, the data remains available for 15 days with 1-minute
resolution. After 15 days, this data is still available, but is aggregated and retrievable only with a resolution
of 5 minutes. After 63 days, the data is further aggregated and is available with a resolution of 1 hour.
</p>
<p>
CloudWatch started retaining 5-minute and 1-hour metric data as of July 9, 2016.
</p>
<p>
For information about metrics and dimensions supported by Amazon Web Services services, see the <a
href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CW_Support_For_AWS.html">Amazon CloudWatch
Metrics and Dimensions Reference</a> in the <i>Amazon CloudWatch User Guide</i>.
</p>

@param getMetricStatisticsRequest
@return Result of the GetMetricStatistics operation returned by the service.
@throws InvalidParameterValueException
        The value of an input parameter is bad or out-of-range.
@throws MissingRequiredParameterException
        An input parameter that is required is missing.
@throws InvalidParameterCombinationException
        Parameters were used together that cannot be used together.
@throws InternalServiceException
        Request processing has failed due to some unknown error, exception, or failure.
@sample AmazonCloudWatch.GetMetricStatistics
@see <a href="http://docs.aws.amazon.com/goto/WebAPI/monitoring-2010-08-01/GetMetricStatistics" target="_top">AWS
     API Documentation</a>
aws-java-sdk-cloudwatch/src/main/java/com/amazonaws/services/cloudwatch/AmazonCloudWatchClient.java