AWS SDK Version 3 for .NET
API Reference

AWS services or capabilities described in AWS Documentation may vary by region/location. Click Getting Started with Amazon AWS to see specific differences applicable to the China (Beijing) Region.

Container for the parameters to the GetMetricData operation. You can use the GetMetricData API to retrieve as many as 100 different metrics in a single request, with a total of as many as 100,800 datapoints. You can also optionally perform math expressions on the values of the returned statistics, to create new time series that represent new insights into your data. For example, using Lambda metrics, you could divide the Errors metric by the Invocations metric to get an error rate time series. For more information about metric math expressions, see Metric Math Syntax and Functions in the Amazon CloudWatch User Guide.

Calls to the GetMetricData API have a different pricing structure than calls to GetMetricStatistics. For more information about pricing, see Amazon CloudWatch Pricing.

Amazon CloudWatch retains metric data as follows:

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.

Inheritance Hierarchy

System.Object
  Amazon.Runtime.AmazonWebServiceRequest
    Amazon.CloudWatch.AmazonCloudWatchRequest
      Amazon.CloudWatch.Model.GetMetricDataRequest

Namespace: Amazon.CloudWatch.Model
Assembly: AWSSDK.CloudWatch.dll
Version: 3.x.y.z

Syntax

C#
public class GetMetricDataRequest : AmazonCloudWatchRequest
         IAmazonWebServiceRequest

The GetMetricDataRequest type exposes the following members

Constructors

NameDescription
Public Method GetMetricDataRequest()

Properties

NameTypeDescription
Public Property EndTime System.DateTime

Gets and sets the property EndTime.

The time stamp indicating the latest data to be returned.

For better performance, specify StartTime and EndTime values that align with the value of the metric's Period and sync up with the beginning and end of an hour. For example, if the Period of a metric is 5 minutes, specifying 12:05 or 12:30 as EndTime can get a faster response from CloudWatch then setting 12:07 or 12:29 as the EndTime.

Public Property MaxDatapoints System.Int32

Gets and sets the property MaxDatapoints.

The maximum number of data points the request should return before paginating. If you omit this, the default of 100,800 is used.

Public Property MetricDataQueries System.Collections.Generic.List<Amazon.CloudWatch.Model.MetricDataQuery>

Gets and sets the property MetricDataQueries.

The metric queries to be returned. A single GetMetricData call can include as many as 100 MetricDataQuery structures. Each of these structures can specify either a metric to retrieve, or a math expression to perform on retrieved data.

Public Property NextToken System.String

Gets and sets the property NextToken.

Include this value, if it was returned by the previous call, to get the next set of data points.

Public Property ScanBy Amazon.CloudWatch.ScanBy

Gets and sets the property ScanBy.

The order in which data points should be returned. TimestampDescending returns the newest data first and paginates when the MaxDatapoints limit is reached. TimestampAscending returns the oldest data first and paginates when the MaxDatapoints limit is reached.

Public Property StartTime System.DateTime

Gets and sets the property StartTime.

The time stamp indicating the earliest data to be returned.

For better performance, specify StartTime and EndTime values that align with the value of the metric's Period and sync up with the beginning and end of an hour. For example, if the Period of a metric is 5 minutes, specifying 12:05 or 12:30 as StartTime can get a faster response from CloudWatch then setting 12:07 or 12:29 as the StartTime.

Version Information

.NET Standard:
Supported in: 1.3

.NET Framework:
Supported in: 4.5, 4.0, 3.5

Portable Class Library:
Supported in: Windows Store Apps
Supported in: Windows Phone 8.1
Supported in: Xamarin Android
Supported in: Xamarin iOS (Unified)
Supported in: Xamarin.Forms