diff --git a/docs/openapi/monitoring-api.json b/docs/openapi/monitoring-api.json index ccd3413..d25734a 100644 --- a/docs/openapi/monitoring-api.json +++ b/docs/openapi/monitoring-api.json @@ -24474,14 +24474,12 @@ ] }, "timing": { - "type": "object", - "additionalProperties": { - "type": "object", - "description": "Request phase timing breakdown", - "nullable": true - }, - "description": "Request phase timing breakdown", - "nullable": true + "nullable": true, + "allOf": [ + { + "$ref": "#/components/schemas/TimingPhasesDto" + } + ] }, "bodyTruncated": { "type": "boolean", @@ -31653,6 +31651,54 @@ }, "description": "Event type to use for a test webhook delivery" }, + "TimingPhasesDto": { + "type": "object", + "properties": { + "dns_ms": { + "type": "integer", + "description": "DNS resolution time in milliseconds", + "format": "int32", + "nullable": true, + "example": 12 + }, + "tcp_ms": { + "type": "integer", + "description": "TCP connect time in milliseconds", + "format": "int32", + "nullable": true, + "example": 18 + }, + "tls_ms": { + "type": "integer", + "description": "TLS handshake time in milliseconds (null for plain HTTP)", + "format": "int32", + "nullable": true, + "example": 34 + }, + "ttfb_ms": { + "type": "integer", + "description": "Time to first response byte in milliseconds", + "format": "int32", + "nullable": true, + "example": 42 + }, + "download_ms": { + "type": "integer", + "description": "Response body download time in milliseconds", + "format": "int32", + "nullable": true, + "example": 8 + }, + "total_ms": { + "type": "integer", + "description": "Total wall-clock request time in milliseconds", + "format": "int32", + "nullable": true, + "example": 114 + } + }, + "description": "Per-phase HTTP request timing breakdown (milliseconds)" + }, "TlsInfoDto": { "type": "object", "properties": { diff --git a/src/lib/api-zod.generated.ts b/src/lib/api-zod.generated.ts index 9a50c15..bcc5c83 100644 --- a/src/lib/api-zod.generated.ts +++ b/src/lib/api-zod.generated.ts @@ -1511,10 +1511,21 @@ const TlsInfoDto = z }) .partial() .strict(); +const TimingPhasesDto = z + .object({ + dns_ms: z.number().int().nullable(), + tcp_ms: z.number().int().nullable(), + tls_ms: z.number().int().nullable(), + ttfb_ms: z.number().int().nullable(), + download_ms: z.number().int().nullable(), + total_ms: z.number().int().nullable(), + }) + .partial() + .strict(); const Http = z .object({ check_type: z.literal("http"), - timing: z.record(z.object({}).partial().strict().nullable()).nullish(), + timing: TimingPhasesDto.nullish(), bodyTruncated: z.boolean().nullish(), }) .strict(); @@ -3359,6 +3370,7 @@ export const schemas = { CategoryDto, ChartBucketDto, TlsInfoDto, + TimingPhasesDto, Http, Tcp, Icmp, diff --git a/src/lib/api.generated.ts b/src/lib/api.generated.ts index 03eed5b..bb7edce 100644 --- a/src/lib/api.generated.ts +++ b/src/lib/api.generated.ts @@ -3897,10 +3897,7 @@ export interface components { * @enum {string} */ check_type: "http"; - /** @description Request phase timing breakdown */ - timing?: { - [key: string]: Record | null; - } | null; + timing?: components["schemas"]["TimingPhasesDto"] | null; /** @description Whether the response body was truncated before storage */ bodyTruncated?: boolean | null; }; @@ -6696,6 +6693,45 @@ export interface components { /** @description Event type to simulate (e.g. monitor.created); null uses a default */ eventType?: string | null; }; + /** @description Per-phase HTTP request timing breakdown (milliseconds) */ + TimingPhasesDto: { + /** + * Format: int32 + * @description DNS resolution time in milliseconds + * @example 12 + */ + dns_ms?: number | null; + /** + * Format: int32 + * @description TCP connect time in milliseconds + * @example 18 + */ + tcp_ms?: number | null; + /** + * Format: int32 + * @description TLS handshake time in milliseconds (null for plain HTTP) + * @example 34 + */ + tls_ms?: number | null; + /** + * Format: int32 + * @description Time to first response byte in milliseconds + * @example 42 + */ + ttfb_ms?: number | null; + /** + * Format: int32 + * @description Response body download time in milliseconds + * @example 8 + */ + download_ms?: number | null; + /** + * Format: int32 + * @description Total wall-clock request time in milliseconds + * @example 114 + */ + total_ms?: number | null; + }; /** @description TLS/SSL certificate details for HTTPS targets */ TlsInfoDto: { /**