The best way to control Claude Code, Codex and more from any computer or phone
Mirrored from https://github.com/Camo67/t3code.git
Synced Nov 21, 04:45 UTC
| 1 | import type * as rum from "@distilled.cloud/aws/rum"; |
| 2 | import * as Binding from "alchemy/Binding"; |
| 3 | import type * as Effect from "effect/Effect"; |
| 4 | import type { AppMonitor } from "./AppMonitor.ts"; |
| 5 | |
| 6 | export interface GetAppMonitorDataRequest extends Omit<rum.GetAppMonitorDataRequest, "Name"> {} |
| 7 | |
| 8 | /** |
| 9 | * Runtime binding for `rum:GetAppMonitorData` — retrieve the raw performance |
| 10 | * and error events that CloudWatch RUM collected from the bound |
| 11 | * {@link AppMonitor} for your own processing or analysis; the monitor name |
| 12 | * is injected automatically. |
| 13 | * |
| 14 | * Provide `RUM.GetAppMonitorDataHttp` on the hosting Lambda Function to |
| 15 | * satisfy the requirement. |
| 16 | * ### Reading RUM Telemetry |
| 17 | * **Example:** Read the Trailing Hour of Events |
| 18 | * ```typescript |
| 19 | * // init — grants rum:GetAppMonitorData on the monitor |
| 20 | * const getAppMonitorData = yield* AWS.RUM.GetAppMonitorData(monitor); |
| 21 | * |
| 22 | * // runtime — each event is a JSON string |
| 23 | * const now = Date.now(); |
| 24 | * const { Events } = yield* getAppMonitorData({ |
| 25 | * TimeRange: { After: now - 3_600_000, Before: now }, |
| 26 | * }); |
| 27 | * ``` |
| 28 | * |
| 29 | * @binding |
| 30 | */ |
| 31 | export interface GetAppMonitorData extends Binding.Service< |
| 32 | GetAppMonitorData, |
| 33 | "AWS.RUM.GetAppMonitorData", |
| 34 | ( |
| 35 | monitor: AppMonitor, |
| 36 | ) => Effect.Effect< |
| 37 | ( |
| 38 | request: GetAppMonitorDataRequest, |
| 39 | ) => Effect.Effect<rum.GetAppMonitorDataResponse, rum.GetAppMonitorDataError> |
| 40 | > |
| 41 | > {} |
| 42 | |
| 43 | export const GetAppMonitorData = Binding.Service<GetAppMonitorData>("AWS.RUM.GetAppMonitorData"); |