1import type * as athena from "@distilled.cloud/aws/athena";
2import type * as Effect from "effect/Effect";
3import * as Binding from "../../Binding.ts";
4import type { WorkGroup } from "./WorkGroup.ts";
5
6/**
7 * Runtime binding for `athena:GetQueryRuntimeStatistics`.
8 *
9 * Reads the runtime statistics (timeline, rows/bytes processed, stage tree)
10 * of a query that ran in the bound workgroup. Provide the implementation with
11 * `Effect.provide(AWS.Athena.GetQueryRuntimeStatisticsHttp)`.
12 * ### Inspecting Query Executions
13 * **Example:** Read a Query's Runtime Statistics
14 * ```typescript
15 * // init — bind the operation to the workgroup
16 * const getQueryRuntimeStatistics =
17 * yield* AWS.Athena.GetQueryRuntimeStatistics(workGroup);
18 *
19 * // runtime
20 * const res = yield* getQueryRuntimeStatistics({ QueryExecutionId: id });
21 * console.log(res.QueryRuntimeStatistics?.Timeline?.TotalExecutionTimeInMillis);
22 * ```
23 *
24 * @binding
25 */
26export interface GetQueryRuntimeStatistics extends Binding.Service<
27 GetQueryRuntimeStatistics,
28 "AWS.Athena.GetQueryRuntimeStatistics",
29 (
30 workGroup: WorkGroup,
31 ) => Effect.Effect<
32 (
33 request: athena.GetQueryRuntimeStatisticsInput,
34 ) => Effect.Effect<
35 athena.GetQueryRuntimeStatisticsOutput,
36 athena.GetQueryRuntimeStatisticsError
37 >
38 >
39> {}
40
41export const GetQueryRuntimeStatistics =
42 Binding.Service<GetQueryRuntimeStatistics>(
43 "AWS.Athena.GetQueryRuntimeStatistics",
44 );