From f542ac3f31d6c3ccc9500a431429fdfa1f183c37 Mon Sep 17 00:00:00 2001 From: awstools Date: Tue, 23 Apr 2024 18:21:38 +0000 Subject: [PATCH] docs(client-pi): Clarifies how aggregation works for GetResourceMetrics in the Performance Insights API. --- .../src/commands/GetResourceMetricsCommand.ts | 4 ++-- clients/client-pi/src/models/models_0.ts | 21 +++++++++++++++---- codegen/sdk-codegen/aws-models/pi.json | 10 ++++----- 3 files changed, 24 insertions(+), 11 deletions(-) diff --git a/clients/client-pi/src/commands/GetResourceMetricsCommand.ts b/clients/client-pi/src/commands/GetResourceMetricsCommand.ts index 595057bb23be5..3cb928b83c439 100644 --- a/clients/client-pi/src/commands/GetResourceMetricsCommand.ts +++ b/clients/client-pi/src/commands/GetResourceMetricsCommand.ts @@ -28,8 +28,8 @@ export interface GetResourceMetricsCommandOutput extends GetResourceMetricsRespo /** *

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.

+ * specific dimension groups and dimensions, and provide filtering criteria for each group. You must specify an aggregate function for + * each metric.

* *

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

diff --git a/clients/client-pi/src/models/models_0.ts b/clients/client-pi/src/models/models_0.ts index 4118832001a71..0f6091c7ee3c7 100644 --- a/clients/client-pi/src/models/models_0.ts +++ b/clients/client-pi/src/models/models_0.ts @@ -1244,8 +1244,11 @@ export interface GetResourceMetadataResponse { } /** - *

A single query to be processed. You must provide the metric to query. If no other - * parameters are specified, Performance Insights returns all data points for the specified metric. Optionally, you can + *

A single query to be processed. You must provide the metric to query and append an aggregate function to the metric. + * For example, to find the average for the metric db.load + * you must use db.load.avg. Valid values for aggregate functions include .avg, .min, + * .max, and .sum. + * If no other parameters are specified, Performance Insights returns all data points for the specified metric. Optionally, you can * request that the data points be aggregated by dimension group (GroupBy), and return only * those data points that match your criteria (Filter).

* @public @@ -1268,6 +1271,10 @@ export interface MetricQuery { *

The counter metrics listed in Performance Insights * operating system counters in the Amazon Aurora User Guide.

* + *
  • + *

    The counter metrics listed in Performance Insights + * operating system counters in the Amazon RDS User Guide.

    + *
  • * *

    If the number of active sessions is less than an internal Performance Insights threshold, db.load.avg and db.sampledload.avg are the same * value. If the number of active sessions is greater than the internal threshold, Performance Insights samples the active sessions, with db.load.avg showing the @@ -1348,8 +1355,10 @@ export interface GetResourceMetricsRequest { Identifier: string | undefined; /** - *

    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.

    + *

    An array of one or more queries to perform. Each query must specify a Performance Insights metric and specify an aggregate function, and you can provide filtering + * criteria. You must append the aggregate function to the metric. For example, to find the average for the metric db.load + * you must use db.load.avg. Valid values for aggregate functions include .avg, .min, + * .max, and .sum.

    * @public */ MetricQueries: MetricQuery[] | undefined; @@ -1447,6 +1456,10 @@ export interface ResponseResourceMetricKey { *

    The counter metrics listed in Performance Insights * operating system counters in the Amazon Aurora User Guide.

    * + *
  • + *

    The counter metrics listed in Performance Insights + * operating system counters in the Amazon RDS User Guide.

    + *
  • * *

    If the number of active sessions is less than an internal Performance Insights threshold, db.load.avg and * db.sampledload.avg are the same value. If the number of active sessions is greater than the diff --git a/codegen/sdk-codegen/aws-models/pi.json b/codegen/sdk-codegen/aws-models/pi.json index 73cd583b0453a..26f4fa20a5669 100644 --- a/codegen/sdk-codegen/aws-models/pi.json +++ b/codegen/sdk-codegen/aws-models/pi.json @@ -1096,7 +1096,7 @@ } ], "traits": { - "smithy.api#documentation": "

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

    \n \n

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

    \n
    ", + "smithy.api#documentation": "

    Retrieve Performance Insights metrics for a set of data sources over a time period. You can provide\n specific dimension groups and dimensions, and provide filtering criteria for each group. You must specify an aggregate function for\n each metric.

    \n \n

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

    \n
    ", "smithy.api#paginated": { "inputToken": "NextToken", "outputToken": "NextToken", @@ -1124,7 +1124,7 @@ "MetricQueries": { "target": "com.amazonaws.pi#MetricQueryList", "traits": { - "smithy.api#documentation": "

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

    ", + "smithy.api#documentation": "

    An array of one or more queries to perform. Each query must specify a Performance Insights metric and specify an aggregate function, and you can provide filtering\n criteria. You must append the aggregate function to the metric. For example, to find the average for the metric db.load \n you must use db.load.avg. Valid values for aggregate functions include .avg, .min, \n .max, and .sum.

    ", "smithy.api#required": {} } }, @@ -1742,7 +1742,7 @@ "Metric": { "target": "com.amazonaws.pi#RequestString", "traits": { - "smithy.api#documentation": "

    The name of a Performance Insights metric to be measured.

    \n

    Valid values for Metric are:

    \n \n

    If the number of active sessions is less than an internal Performance Insights threshold, db.load.avg and db.sampledload.avg are the same\n value. If the number of active sessions is greater than the internal threshold, Performance Insights samples the active sessions, with db.load.avg showing the\n scaled values, db.sampledload.avg showing the raw values, and db.sampledload.avg less than\n db.load.avg. For most use cases, you can query db.load.avg only.

    ", + "smithy.api#documentation": "

    The name of a Performance Insights metric to be measured.

    \n

    Valid values for Metric are:

    \n \n

    If the number of active sessions is less than an internal Performance Insights threshold, db.load.avg and db.sampledload.avg are the same\n value. If the number of active sessions is greater than the internal threshold, Performance Insights samples the active sessions, with db.load.avg showing the\n scaled values, db.sampledload.avg showing the raw values, and db.sampledload.avg less than\n db.load.avg. For most use cases, you can query db.load.avg only.

    ", "smithy.api#required": {} } }, @@ -1760,7 +1760,7 @@ } }, "traits": { - "smithy.api#documentation": "

    A single query to be processed. You must provide the metric to query. If no other\n parameters are specified, Performance Insights returns all data points for the specified metric. Optionally, you can\n request that the data points be aggregated by dimension group (GroupBy), and return only \n those data points that match your criteria (Filter).

    " + "smithy.api#documentation": "

    A single query to be processed. You must provide the metric to query and append an aggregate function to the metric.\n For example, to find the average for the metric db.load \n you must use db.load.avg. Valid values for aggregate functions include .avg, .min, \n .max, and .sum.\n If no other parameters are specified, Performance Insights returns all data points for the specified metric. Optionally, you can\n request that the data points be aggregated by dimension group (GroupBy), and return only \n those data points that match your criteria (Filter).

    " } }, "com.amazonaws.pi#MetricQueryFilterMap": { @@ -2944,7 +2944,7 @@ "Metric": { "target": "com.amazonaws.pi#String", "traits": { - "smithy.api#documentation": "

    The name of a Performance Insights metric to be measured.

    \n

    Valid values for Metric are:

    \n \n

    If the number of active sessions is less than an internal Performance Insights threshold, db.load.avg and \n db.sampledload.avg are the same value. If the number of active sessions is greater than the \n internal threshold, Performance Insights samples the active sessions, with db.load.avg showing the scaled values, \n db.sampledload.avg showing the raw values, and db.sampledload.avg less \n than db.load.avg. For most use cases, you can query db.load.avg only.\n

    ", + "smithy.api#documentation": "

    The name of a Performance Insights metric to be measured.

    \n

    Valid values for Metric are:

    \n \n

    If the number of active sessions is less than an internal Performance Insights threshold, db.load.avg and \n db.sampledload.avg are the same value. If the number of active sessions is greater than the \n internal threshold, Performance Insights samples the active sessions, with db.load.avg showing the scaled values, \n db.sampledload.avg showing the raw values, and db.sampledload.avg less \n than db.load.avg. For most use cases, you can query db.load.avg only.\n

    ", "smithy.api#required": {} } },