Skip to content

Commit 2caa046

Browse files
author
awstools
committed
feat(client-timestream-query): This release adds support for Query Insights, a feature that provides details of query execution, enabling users to identify areas for improvement to optimize their queries, resulting in improved query performance and lower query costs.
1 parent fa3d3d0 commit 2caa046

File tree

7 files changed

+757
-4
lines changed

7 files changed

+757
-4
lines changed

clients/client-timestream-query/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ AWS SDK for JavaScript TimestreamQuery Client for Node.js, Browser and React Nat
1313

1414
## Installing
1515

16-
To install the this package, simply type add or install @aws-sdk/client-timestream-query
16+
To install this package, simply type add or install @aws-sdk/client-timestream-query
1717
using your favorite package manager:
1818

1919
- `npm install @aws-sdk/client-timestream-query`

clients/client-timestream-query/src/commands/DescribeScheduledQueryCommand.ts

+40
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,26 @@ export interface DescribeScheduledQueryCommandOutput extends DescribeScheduledQu
122122
* // RecordsIngested: Number("long"),
123123
* // QueryResultRows: Number("long"),
124124
* // },
125+
* // QueryInsightsResponse: { // ScheduledQueryInsightsResponse
126+
* // QuerySpatialCoverage: { // QuerySpatialCoverage
127+
* // Max: { // QuerySpatialCoverageMax
128+
* // Value: Number("double"),
129+
* // TableArn: "STRING_VALUE",
130+
* // PartitionKey: [ // PartitionKeyList
131+
* // "STRING_VALUE",
132+
* // ],
133+
* // },
134+
* // },
135+
* // QueryTemporalRange: { // QueryTemporalRange
136+
* // Max: { // QueryTemporalRangeMax
137+
* // Value: Number("long"),
138+
* // TableArn: "STRING_VALUE",
139+
* // },
140+
* // },
141+
* // QueryTableCount: Number("long"),
142+
* // OutputRows: Number("long"),
143+
* // OutputBytes: Number("long"),
144+
* // },
125145
* // ErrorReportLocation: { // ErrorReportLocation
126146
* // S3ReportLocation: { // S3ReportLocation
127147
* // BucketName: "STRING_VALUE",
@@ -143,6 +163,26 @@ export interface DescribeScheduledQueryCommandOutput extends DescribeScheduledQu
143163
* // RecordsIngested: Number("long"),
144164
* // QueryResultRows: Number("long"),
145165
* // },
166+
* // QueryInsightsResponse: {
167+
* // QuerySpatialCoverage: {
168+
* // Max: {
169+
* // Value: Number("double"),
170+
* // TableArn: "STRING_VALUE",
171+
* // PartitionKey: [
172+
* // "STRING_VALUE",
173+
* // ],
174+
* // },
175+
* // },
176+
* // QueryTemporalRange: {
177+
* // Max: {
178+
* // Value: Number("long"),
179+
* // TableArn: "STRING_VALUE",
180+
* // },
181+
* // },
182+
* // QueryTableCount: Number("long"),
183+
* // OutputRows: Number("long"),
184+
* // OutputBytes: Number("long"),
185+
* // },
146186
* // ErrorReportLocation: {
147187
* // S3ReportLocation: {
148188
* // BucketName: "STRING_VALUE",

clients/client-timestream-query/src/commands/ExecuteScheduledQueryCommand.ts

+4
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ export interface ExecuteScheduledQueryCommandOutput extends __MetadataBearer {}
3030

3131
/**
3232
* <p> You can use this API to run a scheduled query manually. </p>
33+
* <p>If you enabled <code>QueryInsights</code>, this API also returns insights and metrics related to the query that you executed as part of an Amazon SNS notification. <code>QueryInsights</code> helps with performance tuning of your query.</p>
3334
* @example
3435
* Use a bare-bones client and the command you need to make an API call.
3536
* ```javascript
@@ -40,6 +41,9 @@ export interface ExecuteScheduledQueryCommandOutput extends __MetadataBearer {}
4041
* ScheduledQueryArn: "STRING_VALUE", // required
4142
* InvocationTime: new Date("TIMESTAMP"), // required
4243
* ClientToken: "STRING_VALUE",
44+
* QueryInsights: { // ScheduledQueryInsights
45+
* Mode: "ENABLED_WITH_RATE_CONTROL" || "DISABLED", // required
46+
* },
4347
* };
4448
* const command = new ExecuteScheduledQueryCommand(input);
4549
* const response = await client.send(command);

clients/client-timestream-query/src/commands/QueryCommand.ts

+33-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,13 @@ export interface QueryCommandOutput extends QueryResponse, __MetadataBearer {}
3131
/**
3232
* <p>
3333
* <code>Query</code> is a synchronous operation that enables you to run a query against
34-
* your Amazon Timestream data. <code>Query</code> will time out after 60 seconds.
34+
* your Amazon Timestream data.</p>
35+
* <p>If you enabled <code>QueryInsights</code>, this API also returns insights and metrics related to the query that you executed. <code>QueryInsights</code> helps with performance tuning of your query.</p>
36+
* <note>
37+
* <p>The maximum number of <code>Query</code> API requests you're allowed to make with <code>QueryInsights</code> enabled is 1 query per second (QPS). If you exceed this query rate, it might result in throttling.</p>
38+
* </note>
39+
* <p>
40+
* <code>Query</code> will time out after 60 seconds.
3541
* You must update the default timeout in the SDK to support a timeout of 60 seconds. See
3642
* the <a href="https://docs.aws.amazon.com/timestream/latest/developerguide/code-samples.run-query.html">code
3743
* sample</a> for details. </p>
@@ -71,6 +77,9 @@ export interface QueryCommandOutput extends QueryResponse, __MetadataBearer {}
7177
* ClientToken: "STRING_VALUE",
7278
* NextToken: "STRING_VALUE",
7379
* MaxRows: Number("int"),
80+
* QueryInsights: { // QueryInsights
81+
* Mode: "ENABLED_WITH_RATE_CONTROL" || "DISABLED", // required
82+
* },
7483
* };
7584
* const command = new QueryCommand(input);
7685
* const response = await client.send(command);
@@ -136,6 +145,29 @@ export interface QueryCommandOutput extends QueryResponse, __MetadataBearer {}
136145
* // CumulativeBytesScanned: Number("long"),
137146
* // CumulativeBytesMetered: Number("long"),
138147
* // },
148+
* // QueryInsightsResponse: { // QueryInsightsResponse
149+
* // QuerySpatialCoverage: { // QuerySpatialCoverage
150+
* // Max: { // QuerySpatialCoverageMax
151+
* // Value: Number("double"),
152+
* // TableArn: "STRING_VALUE",
153+
* // PartitionKey: [ // PartitionKeyList
154+
* // "STRING_VALUE",
155+
* // ],
156+
* // },
157+
* // },
158+
* // QueryTemporalRange: { // QueryTemporalRange
159+
* // Max: { // QueryTemporalRangeMax
160+
* // Value: Number("long"),
161+
* // TableArn: "STRING_VALUE",
162+
* // },
163+
* // },
164+
* // QueryTableCount: Number("long"),
165+
* // OutputRows: Number("long"),
166+
* // OutputBytes: Number("long"),
167+
* // UnloadPartitionCount: Number("long"),
168+
* // UnloadWrittenRows: Number("long"),
169+
* // UnloadWrittenBytes: Number("long"),
170+
* // },
139171
* // };
140172
*
141173
* ```

0 commit comments

Comments
 (0)