-
Notifications
You must be signed in to change notification settings - Fork 578
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(client-athena): This feature allows customers to retrieve runtim…
…e statistics for completed queries
- Loading branch information
awstools
committed
Jul 21, 2022
1 parent
a2aef86
commit 6fe9621
Showing
9 changed files
with
897 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
102 changes: 102 additions & 0 deletions
102
clients/client-athena/src/commands/GetQueryRuntimeStatisticsCommand.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,102 @@ | ||
// smithy-typescript generated code | ||
import { getSerdePlugin } from "@aws-sdk/middleware-serde"; | ||
import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@aws-sdk/protocol-http"; | ||
import { Command as $Command } from "@aws-sdk/smithy-client"; | ||
import { | ||
FinalizeHandlerArguments, | ||
Handler, | ||
HandlerExecutionContext, | ||
HttpHandlerOptions as __HttpHandlerOptions, | ||
MetadataBearer as __MetadataBearer, | ||
MiddlewareStack, | ||
SerdeContext as __SerdeContext, | ||
} from "@aws-sdk/types"; | ||
|
||
import { AthenaClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../AthenaClient"; | ||
import { GetQueryRuntimeStatisticsInput, GetQueryRuntimeStatisticsOutput } from "../models/models_0"; | ||
import { | ||
deserializeAws_json1_1GetQueryRuntimeStatisticsCommand, | ||
serializeAws_json1_1GetQueryRuntimeStatisticsCommand, | ||
} from "../protocols/Aws_json1_1"; | ||
|
||
export interface GetQueryRuntimeStatisticsCommandInput extends GetQueryRuntimeStatisticsInput {} | ||
export interface GetQueryRuntimeStatisticsCommandOutput extends GetQueryRuntimeStatisticsOutput, __MetadataBearer {} | ||
|
||
/** | ||
* <p>Returns query execution runtime statistics related to a single execution of a query if you | ||
* have access to the workgroup in which the query ran. The query execution runtime statistics | ||
* is returned only when <a>QueryExecutionStatus$State</a> is in a SUCCEEDED | ||
* or FAILED state.</p> | ||
* @example | ||
* Use a bare-bones client and the command you need to make an API call. | ||
* ```javascript | ||
* import { AthenaClient, GetQueryRuntimeStatisticsCommand } from "@aws-sdk/client-athena"; // ES Modules import | ||
* // const { AthenaClient, GetQueryRuntimeStatisticsCommand } = require("@aws-sdk/client-athena"); // CommonJS import | ||
* const client = new AthenaClient(config); | ||
* const command = new GetQueryRuntimeStatisticsCommand(input); | ||
* const response = await client.send(command); | ||
* ``` | ||
* | ||
* @see {@link GetQueryRuntimeStatisticsCommandInput} for command's `input` shape. | ||
* @see {@link GetQueryRuntimeStatisticsCommandOutput} for command's `response` shape. | ||
* @see {@link AthenaClientResolvedConfig | config} for AthenaClient's `config` shape. | ||
* | ||
*/ | ||
export class GetQueryRuntimeStatisticsCommand extends $Command< | ||
GetQueryRuntimeStatisticsCommandInput, | ||
GetQueryRuntimeStatisticsCommandOutput, | ||
AthenaClientResolvedConfig | ||
> { | ||
// Start section: command_properties | ||
// End section: command_properties | ||
|
||
constructor(readonly input: GetQueryRuntimeStatisticsCommandInput) { | ||
// Start section: command_constructor | ||
super(); | ||
// End section: command_constructor | ||
} | ||
|
||
/** | ||
* @internal | ||
*/ | ||
resolveMiddleware( | ||
clientStack: MiddlewareStack<ServiceInputTypes, ServiceOutputTypes>, | ||
configuration: AthenaClientResolvedConfig, | ||
options?: __HttpHandlerOptions | ||
): Handler<GetQueryRuntimeStatisticsCommandInput, GetQueryRuntimeStatisticsCommandOutput> { | ||
this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize)); | ||
|
||
const stack = clientStack.concat(this.middlewareStack); | ||
|
||
const { logger } = configuration; | ||
const clientName = "AthenaClient"; | ||
const commandName = "GetQueryRuntimeStatisticsCommand"; | ||
const handlerExecutionContext: HandlerExecutionContext = { | ||
logger, | ||
clientName, | ||
commandName, | ||
inputFilterSensitiveLog: GetQueryRuntimeStatisticsInput.filterSensitiveLog, | ||
outputFilterSensitiveLog: GetQueryRuntimeStatisticsOutput.filterSensitiveLog, | ||
}; | ||
const { requestHandler } = configuration; | ||
return stack.resolve( | ||
(request: FinalizeHandlerArguments<any>) => | ||
requestHandler.handle(request.request as __HttpRequest, options || {}), | ||
handlerExecutionContext | ||
); | ||
} | ||
|
||
private serialize(input: GetQueryRuntimeStatisticsCommandInput, context: __SerdeContext): Promise<__HttpRequest> { | ||
return serializeAws_json1_1GetQueryRuntimeStatisticsCommand(input, context); | ||
} | ||
|
||
private deserialize( | ||
output: __HttpResponse, | ||
context: __SerdeContext | ||
): Promise<GetQueryRuntimeStatisticsCommandOutput> { | ||
return deserializeAws_json1_1GetQueryRuntimeStatisticsCommand(output, context); | ||
} | ||
|
||
// Start section: command_body_extra | ||
// End section: command_body_extra | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.