amazonka-cloudwatch-1.4.5: Amazon CloudWatch SDK.

Copyright(c) 2013-2016 Brendan Hay
LicenseMozilla Public License, v. 2.0.
MaintainerBrendan Hay <brendan.g.hay@gmail.com>
Stabilityauto-generated
Portabilitynon-portable (GHC extensions)
Safe HaskellNone
LanguageHaskell2010

Network.AWS.CloudWatch.GetMetricStatistics

Contents

Description

Gets statistics for the specified metric.

Amazon CloudWatch retains metric data as follows:

  • Data points with a period of 60 seconds (1 minute) are available for 15 days
  • Data points with a period of 300 seconds (5 minute) are available for 63 days
  • Data points with a period of 3600 seconds (1 hour) are available for 455 days (15 months)

Note that CloudWatch started retaining 5-minute and 1-hour metric data as of 9 July 2016.

The maximum number of data points returned from a single call is 1,440. If you request more than 1,440 data points, Amazon 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. A period can be as short as one minute (60 seconds). Note that data points are not returned 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-hour period, Amazon 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.

For a list of metrics and dimensions supported by AWS services, see the Amazon CloudWatch Metrics and Dimensions Reference in the Amazon CloudWatch User Guide .

Synopsis

Creating a Request

getMetricStatistics Source #

Creates a value of GetMetricStatistics with the minimum fields required to make a request.

Use one of the following lenses to modify other fields as desired:

  • gmsExtendedStatistics - The percentile statistics. Specify values between p0.0 and p100.
  • gmsStatistics - The metric statistics, other than percentile. For percentile statistics, use ExtendedStatistic .
  • gmsDimensions - The dimensions. CloudWatch treats each unique combination of dimensions as a separate metric. You can't retrieve statistics using combinations of dimensions that were not specially published. 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 .
  • gmsUnit - The unit for a given metric. Metrics may be reported in multiple units. Not supplying a unit results in all units being returned. If the metric only ever reports one unit, specifying a unit has no effect.
  • gmsNamespace - The namespace of the metric, with or without spaces.
  • gmsMetricName - The name of the metric, with or without spaces.
  • gmsStartTime - The time stamp that determines the first data point to return. Note that 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. 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.
  • gmsEndTime - The time stamp that determines the last data point to return. The value specified is exclusive; results will include data points up to the specified time stamp. The time stamp must be in ISO 8601 UTC format (for example, 2016-10-10T23:00:00Z).
  • gmsPeriod - The granularity, in seconds, of the returned data points. A period can be as short as one minute (60 seconds) and must be a multiple of 60. The default value is 60. If the StartTime parameter specifies a time stamp that is greater than 15 days ago, you must specify the period as follows or no data points in that time range is returned: * 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).

data GetMetricStatistics Source #

See: getMetricStatistics smart constructor.

Instances

Eq GetMetricStatistics Source # 
Data GetMetricStatistics Source # 

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> GetMetricStatistics -> c GetMetricStatistics #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c GetMetricStatistics #

toConstr :: GetMetricStatistics -> Constr #

dataTypeOf :: GetMetricStatistics -> DataType #

dataCast1 :: Typeable (* -> *) t => (forall d. Data d => c (t d)) -> Maybe (c GetMetricStatistics) #

dataCast2 :: Typeable (* -> * -> *) t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c GetMetricStatistics) #

gmapT :: (forall b. Data b => b -> b) -> GetMetricStatistics -> GetMetricStatistics #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> GetMetricStatistics -> r #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> GetMetricStatistics -> r #

gmapQ :: (forall d. Data d => d -> u) -> GetMetricStatistics -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> GetMetricStatistics -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> GetMetricStatistics -> m GetMetricStatistics #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> GetMetricStatistics -> m GetMetricStatistics #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> GetMetricStatistics -> m GetMetricStatistics #

Read GetMetricStatistics Source # 
Show GetMetricStatistics Source # 
Generic GetMetricStatistics Source # 
Hashable GetMetricStatistics Source # 
NFData GetMetricStatistics Source # 

Methods

rnf :: GetMetricStatistics -> () #

AWSRequest GetMetricStatistics Source # 
ToPath GetMetricStatistics Source # 
ToHeaders GetMetricStatistics Source # 
ToQuery GetMetricStatistics Source # 
type Rep GetMetricStatistics Source # 
type Rs GetMetricStatistics Source # 

Request Lenses

gmsExtendedStatistics :: Lens' GetMetricStatistics (Maybe (NonEmpty Text)) Source #

The percentile statistics. Specify values between p0.0 and p100.

gmsStatistics :: Lens' GetMetricStatistics (Maybe (NonEmpty Statistic)) Source #

The metric statistics, other than percentile. For percentile statistics, use ExtendedStatistic .

gmsDimensions :: Lens' GetMetricStatistics [Dimension] Source #

The dimensions. CloudWatch treats each unique combination of dimensions as a separate metric. You can't retrieve statistics using combinations of dimensions that were not specially published. 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 .

gmsUnit :: Lens' GetMetricStatistics (Maybe StandardUnit) Source #

The unit for a given metric. Metrics may be reported in multiple units. Not supplying a unit results in all units being returned. If the metric only ever reports one unit, specifying a unit has no effect.

gmsNamespace :: Lens' GetMetricStatistics Text Source #

The namespace of the metric, with or without spaces.

gmsMetricName :: Lens' GetMetricStatistics Text Source #

The name of the metric, with or without spaces.

gmsStartTime :: Lens' GetMetricStatistics UTCTime Source #

The time stamp that determines the first data point to return. Note that 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. 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.

gmsEndTime :: Lens' GetMetricStatistics UTCTime Source #

The time stamp that determines the last data point to return. The value specified is exclusive; results will include data points up to the specified time stamp. The time stamp must be in ISO 8601 UTC format (for example, 2016-10-10T23:00:00Z).

gmsPeriod :: Lens' GetMetricStatistics Natural Source #

The granularity, in seconds, of the returned data points. A period can be as short as one minute (60 seconds) and must be a multiple of 60. The default value is 60. If the StartTime parameter specifies a time stamp that is greater than 15 days ago, you must specify the period as follows or no data points in that time range is returned: * 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).

Destructuring the Response

getMetricStatisticsResponse Source #

Creates a value of GetMetricStatisticsResponse with the minimum fields required to make a request.

Use one of the following lenses to modify other fields as desired:

data GetMetricStatisticsResponse Source #

See: getMetricStatisticsResponse smart constructor.

Instances

Eq GetMetricStatisticsResponse Source # 
Data GetMetricStatisticsResponse Source # 

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> GetMetricStatisticsResponse -> c GetMetricStatisticsResponse #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c GetMetricStatisticsResponse #

toConstr :: GetMetricStatisticsResponse -> Constr #

dataTypeOf :: GetMetricStatisticsResponse -> DataType #

dataCast1 :: Typeable (* -> *) t => (forall d. Data d => c (t d)) -> Maybe (c GetMetricStatisticsResponse) #

dataCast2 :: Typeable (* -> * -> *) t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c GetMetricStatisticsResponse) #

gmapT :: (forall b. Data b => b -> b) -> GetMetricStatisticsResponse -> GetMetricStatisticsResponse #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> GetMetricStatisticsResponse -> r #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> GetMetricStatisticsResponse -> r #

gmapQ :: (forall d. Data d => d -> u) -> GetMetricStatisticsResponse -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> GetMetricStatisticsResponse -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> GetMetricStatisticsResponse -> m GetMetricStatisticsResponse #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> GetMetricStatisticsResponse -> m GetMetricStatisticsResponse #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> GetMetricStatisticsResponse -> m GetMetricStatisticsResponse #

Read GetMetricStatisticsResponse Source # 
Show GetMetricStatisticsResponse Source # 
Generic GetMetricStatisticsResponse Source # 
NFData GetMetricStatisticsResponse Source # 
type Rep GetMetricStatisticsResponse Source # 
type Rep GetMetricStatisticsResponse = D1 (MetaData "GetMetricStatisticsResponse" "Network.AWS.CloudWatch.GetMetricStatistics" "amazonka-cloudwatch-1.4.5-EKf9JeTVY7e7Vri5LpiDhT" False) (C1 (MetaCons "GetMetricStatisticsResponse'" PrefixI True) ((:*:) (S1 (MetaSel (Just Symbol "_gmsrsDatapoints") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (Maybe [Datapoint]))) ((:*:) (S1 (MetaSel (Just Symbol "_gmsrsLabel") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (Maybe Text))) (S1 (MetaSel (Just Symbol "_gmsrsResponseStatus") NoSourceUnpackedness SourceStrict DecidedUnpack) (Rec0 Int)))))

Response Lenses

gmsrsDatapoints :: Lens' GetMetricStatisticsResponse [Datapoint] Source #

The data points for the specified metric.

gmsrsLabel :: Lens' GetMetricStatisticsResponse (Maybe Text) Source #

A label for the specified metric.