amazonka-pi-2.0: Amazon Performance Insights SDK.
Copyright(c) 2013-2023 Brendan Hay
LicenseMozilla Public License, v. 2.0.
MaintainerBrendan Hay
Stabilityauto-generated
Portabilitynon-portable (GHC extensions)
Safe HaskellSafe-Inferred
LanguageHaskell2010

Amazonka.Pi.GetResourceMetrics

Description

Retrieve Performance Insights metrics for a set of data sources over a time period. You can provide specific dimension groups and dimensions, and provide aggregation and filtering criteria for each group.

Each response element returns a maximum of 500 bytes. For larger elements, such as SQL statements, only the first 500 bytes are returned.

Synopsis

Creating a Request

data GetResourceMetrics Source #

See: newGetResourceMetrics smart constructor.

Constructors

GetResourceMetrics' 

Fields

  • maxResults :: Maybe Natural

    The maximum number of items to return in the response. If more items exist than the specified MaxRecords value, a pagination token is included in the response so that the remaining results can be retrieved.

  • nextToken :: Maybe Text

    An optional pagination token provided by a previous request. If this parameter is specified, the response includes only records beyond the token, up to the value specified by MaxRecords.

  • periodInSeconds :: Maybe Int

    The granularity, in seconds, of the data points returned from Performance Insights. A period can be as short as one second, or as long as one day (86400 seconds). Valid values are:

    • 1 (one second)
    • 60 (one minute)
    • 300 (five minutes)
    • 3600 (one hour)
    • 86400 (twenty-four hours)

    If you don't specify PeriodInSeconds, then Performance Insights will choose a value for you, with a goal of returning roughly 100-200 data points in the response.

  • serviceType :: ServiceType

    The Amazon Web Services service for which Performance Insights returns metrics. Valid values are as follows:

    • RDS
    • DOCDB
  • identifier :: Text

    An immutable identifier for a data source that is unique for an Amazon Web Services Region. Performance Insights gathers metrics from this data source. In the console, the identifier is shown as ResourceID. When you call DescribeDBInstances, the identifier is returned as DbiResourceId.

    To use a DB instance as a data source, specify its DbiResourceId value. For example, specify db-ABCDEFGHIJKLMNOPQRSTU1VW2X.

  • metricQueries :: NonEmpty MetricQuery

    An array of one or more queries to perform. Each query must specify a Performance Insights metric, and can optionally specify aggregation and filtering criteria.

  • startTime :: POSIX

    The date and time specifying the beginning of the requested time series query range. You can't specify a StartTime that is earlier than 7 days ago. By default, Performance Insights has 7 days of retention, but you can extend this range up to 2 years. The value specified is inclusive. Thus, the command returns data points equal to or greater than StartTime.

    The value for StartTime must be earlier than the value for EndTime.

  • endTime :: POSIX

    The date and time specifying the end of the requested time series query range. The value specified is exclusive. Thus, the command returns data points less than (but not equal to) EndTime.

    The value for EndTime must be later than the value for StartTime.

Instances

Instances details
ToJSON GetResourceMetrics Source # 
Instance details

Defined in Amazonka.Pi.GetResourceMetrics

ToHeaders GetResourceMetrics Source # 
Instance details

Defined in Amazonka.Pi.GetResourceMetrics

ToPath GetResourceMetrics Source # 
Instance details

Defined in Amazonka.Pi.GetResourceMetrics

ToQuery GetResourceMetrics Source # 
Instance details

Defined in Amazonka.Pi.GetResourceMetrics

AWSRequest GetResourceMetrics Source # 
Instance details

Defined in Amazonka.Pi.GetResourceMetrics

Associated Types

type AWSResponse GetResourceMetrics #

Generic GetResourceMetrics Source # 
Instance details

Defined in Amazonka.Pi.GetResourceMetrics

Associated Types

type Rep GetResourceMetrics :: Type -> Type #

Read GetResourceMetrics Source # 
Instance details

Defined in Amazonka.Pi.GetResourceMetrics

Show GetResourceMetrics Source # 
Instance details

Defined in Amazonka.Pi.GetResourceMetrics

NFData GetResourceMetrics Source # 
Instance details

Defined in Amazonka.Pi.GetResourceMetrics

Methods

rnf :: GetResourceMetrics -> () #

Eq GetResourceMetrics Source # 
Instance details

Defined in Amazonka.Pi.GetResourceMetrics

Hashable GetResourceMetrics Source # 
Instance details

Defined in Amazonka.Pi.GetResourceMetrics

type AWSResponse GetResourceMetrics Source # 
Instance details

Defined in Amazonka.Pi.GetResourceMetrics

type Rep GetResourceMetrics Source # 
Instance details

Defined in Amazonka.Pi.GetResourceMetrics

newGetResourceMetrics Source #

Create a value of GetResourceMetrics with all optional fields omitted.

Use generic-lens or optics to modify other optional fields.

The following record fields are available, with the corresponding lenses provided for backwards compatibility:

$sel:maxResults:GetResourceMetrics', getResourceMetrics_maxResults - The maximum number of items to return in the response. If more items exist than the specified MaxRecords value, a pagination token is included in the response so that the remaining results can be retrieved.

GetResourceMetrics, getResourceMetrics_nextToken - An optional pagination token provided by a previous request. If this parameter is specified, the response includes only records beyond the token, up to the value specified by MaxRecords.

$sel:periodInSeconds:GetResourceMetrics', getResourceMetrics_periodInSeconds - The granularity, in seconds, of the data points returned from Performance Insights. A period can be as short as one second, or as long as one day (86400 seconds). Valid values are:

  • 1 (one second)
  • 60 (one minute)
  • 300 (five minutes)
  • 3600 (one hour)
  • 86400 (twenty-four hours)

If you don't specify PeriodInSeconds, then Performance Insights will choose a value for you, with a goal of returning roughly 100-200 data points in the response.

$sel:serviceType:GetResourceMetrics', getResourceMetrics_serviceType - The Amazon Web Services service for which Performance Insights returns metrics. Valid values are as follows:

  • RDS
  • DOCDB

GetResourceMetrics, getResourceMetrics_identifier - An immutable identifier for a data source that is unique for an Amazon Web Services Region. Performance Insights gathers metrics from this data source. In the console, the identifier is shown as ResourceID. When you call DescribeDBInstances, the identifier is returned as DbiResourceId.

To use a DB instance as a data source, specify its DbiResourceId value. For example, specify db-ABCDEFGHIJKLMNOPQRSTU1VW2X.

$sel:metricQueries:GetResourceMetrics', getResourceMetrics_metricQueries - An array of one or more queries to perform. Each query must specify a Performance Insights metric, and can optionally specify aggregation and filtering criteria.

$sel:startTime:GetResourceMetrics', getResourceMetrics_startTime - The date and time specifying the beginning of the requested time series query range. You can't specify a StartTime that is earlier than 7 days ago. By default, Performance Insights has 7 days of retention, but you can extend this range up to 2 years. The value specified is inclusive. Thus, the command returns data points equal to or greater than StartTime.

The value for StartTime must be earlier than the value for EndTime.

$sel:endTime:GetResourceMetrics', getResourceMetrics_endTime - The date and time specifying the end of the requested time series query range. The value specified is exclusive. Thus, the command returns data points less than (but not equal to) EndTime.

The value for EndTime must be later than the value for StartTime.

Request Lenses

getResourceMetrics_maxResults :: Lens' GetResourceMetrics (Maybe Natural) Source #

The maximum number of items to return in the response. If more items exist than the specified MaxRecords value, a pagination token is included in the response so that the remaining results can be retrieved.

getResourceMetrics_nextToken :: Lens' GetResourceMetrics (Maybe Text) Source #

An optional pagination token provided by a previous request. If this parameter is specified, the response includes only records beyond the token, up to the value specified by MaxRecords.

getResourceMetrics_periodInSeconds :: Lens' GetResourceMetrics (Maybe Int) Source #

The granularity, in seconds, of the data points returned from Performance Insights. A period can be as short as one second, or as long as one day (86400 seconds). Valid values are:

  • 1 (one second)
  • 60 (one minute)
  • 300 (five minutes)
  • 3600 (one hour)
  • 86400 (twenty-four hours)

If you don't specify PeriodInSeconds, then Performance Insights will choose a value for you, with a goal of returning roughly 100-200 data points in the response.

getResourceMetrics_serviceType :: Lens' GetResourceMetrics ServiceType Source #

The Amazon Web Services service for which Performance Insights returns metrics. Valid values are as follows:

  • RDS
  • DOCDB

getResourceMetrics_identifier :: Lens' GetResourceMetrics Text Source #

An immutable identifier for a data source that is unique for an Amazon Web Services Region. Performance Insights gathers metrics from this data source. In the console, the identifier is shown as ResourceID. When you call DescribeDBInstances, the identifier is returned as DbiResourceId.

To use a DB instance as a data source, specify its DbiResourceId value. For example, specify db-ABCDEFGHIJKLMNOPQRSTU1VW2X.

getResourceMetrics_metricQueries :: Lens' GetResourceMetrics (NonEmpty MetricQuery) Source #

An array of one or more queries to perform. Each query must specify a Performance Insights metric, and can optionally specify aggregation and filtering criteria.

getResourceMetrics_startTime :: Lens' GetResourceMetrics UTCTime Source #

The date and time specifying the beginning of the requested time series query range. You can't specify a StartTime that is earlier than 7 days ago. By default, Performance Insights has 7 days of retention, but you can extend this range up to 2 years. The value specified is inclusive. Thus, the command returns data points equal to or greater than StartTime.

The value for StartTime must be earlier than the value for EndTime.

getResourceMetrics_endTime :: Lens' GetResourceMetrics UTCTime Source #

The date and time specifying the end of the requested time series query range. The value specified is exclusive. Thus, the command returns data points less than (but not equal to) EndTime.

The value for EndTime must be later than the value for StartTime.

Destructuring the Response

data GetResourceMetricsResponse Source #

See: newGetResourceMetricsResponse smart constructor.

Constructors

GetResourceMetricsResponse' 

Fields

  • alignedEndTime :: Maybe POSIX

    The end time for the returned metrics, after alignment to a granular boundary (as specified by PeriodInSeconds). AlignedEndTime will be greater than or equal to the value of the user-specified Endtime.

  • alignedStartTime :: Maybe POSIX

    The start time for the returned metrics, after alignment to a granular boundary (as specified by PeriodInSeconds). AlignedStartTime will be less than or equal to the value of the user-specified StartTime.

  • identifier :: Maybe Text

    An immutable identifier for a data source that is unique for an Amazon Web Services Region. Performance Insights gathers metrics from this data source. In the console, the identifier is shown as ResourceID. When you call DescribeDBInstances, the identifier is returned as DbiResourceId.

  • metricList :: Maybe [MetricKeyDataPoints]

    An array of metric results, where each array element contains all of the data points for a particular dimension.

  • nextToken :: Maybe Text

    An optional pagination token provided by a previous request. If this parameter is specified, the response includes only records beyond the token, up to the value specified by MaxRecords.

  • httpStatus :: Int

    The response's http status code.

Instances

Instances details
Generic GetResourceMetricsResponse Source # 
Instance details

Defined in Amazonka.Pi.GetResourceMetrics

Associated Types

type Rep GetResourceMetricsResponse :: Type -> Type #

Read GetResourceMetricsResponse Source # 
Instance details

Defined in Amazonka.Pi.GetResourceMetrics

Show GetResourceMetricsResponse Source # 
Instance details

Defined in Amazonka.Pi.GetResourceMetrics

NFData GetResourceMetricsResponse Source # 
Instance details

Defined in Amazonka.Pi.GetResourceMetrics

Eq GetResourceMetricsResponse Source # 
Instance details

Defined in Amazonka.Pi.GetResourceMetrics

type Rep GetResourceMetricsResponse Source # 
Instance details

Defined in Amazonka.Pi.GetResourceMetrics

type Rep GetResourceMetricsResponse = D1 ('MetaData "GetResourceMetricsResponse" "Amazonka.Pi.GetResourceMetrics" "amazonka-pi-2.0-JFFapck1KySFz4VqF9F326" 'False) (C1 ('MetaCons "GetResourceMetricsResponse'" 'PrefixI 'True) ((S1 ('MetaSel ('Just "alignedEndTime") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe POSIX)) :*: (S1 ('MetaSel ('Just "alignedStartTime") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe POSIX)) :*: S1 ('MetaSel ('Just "identifier") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Text)))) :*: (S1 ('MetaSel ('Just "metricList") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe [MetricKeyDataPoints])) :*: (S1 ('MetaSel ('Just "nextToken") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Text)) :*: S1 ('MetaSel ('Just "httpStatus") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Int)))))

newGetResourceMetricsResponse Source #

Create a value of GetResourceMetricsResponse with all optional fields omitted.

Use generic-lens or optics to modify other optional fields.

The following record fields are available, with the corresponding lenses provided for backwards compatibility:

$sel:alignedEndTime:GetResourceMetricsResponse', getResourceMetricsResponse_alignedEndTime - The end time for the returned metrics, after alignment to a granular boundary (as specified by PeriodInSeconds). AlignedEndTime will be greater than or equal to the value of the user-specified Endtime.

$sel:alignedStartTime:GetResourceMetricsResponse', getResourceMetricsResponse_alignedStartTime - The start time for the returned metrics, after alignment to a granular boundary (as specified by PeriodInSeconds). AlignedStartTime will be less than or equal to the value of the user-specified StartTime.

GetResourceMetrics, getResourceMetricsResponse_identifier - An immutable identifier for a data source that is unique for an Amazon Web Services Region. Performance Insights gathers metrics from this data source. In the console, the identifier is shown as ResourceID. When you call DescribeDBInstances, the identifier is returned as DbiResourceId.

$sel:metricList:GetResourceMetricsResponse', getResourceMetricsResponse_metricList - An array of metric results, where each array element contains all of the data points for a particular dimension.

GetResourceMetrics, getResourceMetricsResponse_nextToken - An optional pagination token provided by a previous request. If this parameter is specified, the response includes only records beyond the token, up to the value specified by MaxRecords.

$sel:httpStatus:GetResourceMetricsResponse', getResourceMetricsResponse_httpStatus - The response's http status code.

Response Lenses

getResourceMetricsResponse_alignedEndTime :: Lens' GetResourceMetricsResponse (Maybe UTCTime) Source #

The end time for the returned metrics, after alignment to a granular boundary (as specified by PeriodInSeconds). AlignedEndTime will be greater than or equal to the value of the user-specified Endtime.

getResourceMetricsResponse_alignedStartTime :: Lens' GetResourceMetricsResponse (Maybe UTCTime) Source #

The start time for the returned metrics, after alignment to a granular boundary (as specified by PeriodInSeconds). AlignedStartTime will be less than or equal to the value of the user-specified StartTime.

getResourceMetricsResponse_identifier :: Lens' GetResourceMetricsResponse (Maybe Text) Source #

An immutable identifier for a data source that is unique for an Amazon Web Services Region. Performance Insights gathers metrics from this data source. In the console, the identifier is shown as ResourceID. When you call DescribeDBInstances, the identifier is returned as DbiResourceId.

getResourceMetricsResponse_metricList :: Lens' GetResourceMetricsResponse (Maybe [MetricKeyDataPoints]) Source #

An array of metric results, where each array element contains all of the data points for a particular dimension.

getResourceMetricsResponse_nextToken :: Lens' GetResourceMetricsResponse (Maybe Text) Source #

An optional pagination token provided by a previous request. If this parameter is specified, the response includes only records beyond the token, up to the value specified by MaxRecords.