Copyright | (c) 2013-2018 Brendan Hay |
---|---|
License | Mozilla Public License, v. 2.0. |
Maintainer | Brendan Hay <brendan.g.hay+amazonka@gmail.com> |
Stability | auto-generated |
Portability | non-portable (GHC extensions) |
Safe Haskell | None |
Language | Haskell2010 |
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 .
- getMetricData :: UTCTime -> UTCTime -> GetMetricData
- data GetMetricData
- gmdMaxDatapoints :: Lens' GetMetricData (Maybe Int)
- gmdNextToken :: Lens' GetMetricData (Maybe Text)
- gmdScanBy :: Lens' GetMetricData (Maybe ScanBy)
- gmdMetricDataQueries :: Lens' GetMetricData [MetricDataQuery]
- gmdStartTime :: Lens' GetMetricData UTCTime
- gmdEndTime :: Lens' GetMetricData UTCTime
- getMetricDataResponse :: Int -> GetMetricDataResponse
- data GetMetricDataResponse
- gmdrsMetricDataResults :: Lens' GetMetricDataResponse [MetricDataResult]
- gmdrsNextToken :: Lens' GetMetricDataResponse (Maybe Text)
- gmdrsResponseStatus :: Lens' GetMetricDataResponse Int
Creating a Request
Creates a value of GetMetricData
with the minimum fields required to make a request.
Use one of the following lenses to modify other fields as desired:
gmdMaxDatapoints
- The maximum number of data points the request should return before paginating. If you omit this, the default of 100,800 is used.gmdNextToken
- Include this value, if it was returned by the previous call, to get the next set of data points.gmdScanBy
- The order in which data points should be returned.TimestampDescending
returns the newest data first and paginates when theMaxDatapoints
limit is reached.TimestampAscending
returns the oldest data first and paginates when theMaxDatapoints
limit is reached.gmdMetricDataQueries
- The metric queries to be returned. A singleGetMetricData
call can include as many as 100MetricDataQuery
structures. Each of these structures can specify either a metric to retrieve, or a math expression to perform on retrieved data.gmdStartTime
- The time stamp indicating the earliest data to be returned.gmdEndTime
- The time stamp indicating the latest data to be returned.
data GetMetricData Source #
See: getMetricData
smart constructor.
Request Lenses
gmdMaxDatapoints :: Lens' GetMetricData (Maybe Int) Source #
The maximum number of data points the request should return before paginating. If you omit this, the default of 100,800 is used.
gmdNextToken :: Lens' GetMetricData (Maybe Text) Source #
Include this value, if it was returned by the previous call, to get the next set of data points.
gmdScanBy :: Lens' GetMetricData (Maybe ScanBy) Source #
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.
gmdMetricDataQueries :: Lens' GetMetricData [MetricDataQuery] Source #
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.
gmdStartTime :: Lens' GetMetricData UTCTime Source #
The time stamp indicating the earliest data to be returned.
gmdEndTime :: Lens' GetMetricData UTCTime Source #
The time stamp indicating the latest data to be returned.
Destructuring the Response
getMetricDataResponse Source #
Creates a value of GetMetricDataResponse
with the minimum fields required to make a request.
Use one of the following lenses to modify other fields as desired:
gmdrsMetricDataResults
- The metrics that are returned, including the metric name, namespace, and dimensions.gmdrsNextToken
- A token that marks the next batch of returned results.gmdrsResponseStatus
- -- | The response status code.
data GetMetricDataResponse Source #
See: getMetricDataResponse
smart constructor.
Response Lenses
gmdrsMetricDataResults :: Lens' GetMetricDataResponse [MetricDataResult] Source #
The metrics that are returned, including the metric name, namespace, and dimensions.
gmdrsNextToken :: Lens' GetMetricDataResponse (Maybe Text) Source #
A token that marks the next batch of returned results.
gmdrsResponseStatus :: Lens' GetMetricDataResponse Int Source #
- - | The response status code.