/** * Declarative extraction of operation-level metrics from request/response data. * Used by operation wrappers to capture handler-specific profiling events. */ import type { ProfilingEvent, ProfilingEventKind } from "../../../profiling/types"; import type { DownloadStats } from "../handlers/load-model/types"; export type MetricExtractor = (data: T) => Record | undefined; export type TagExtractor = (data: T) => Record | undefined; export interface OperationMetricsConfig { op: string; kind: ProfilingEventKind; fromRequest?: MetricExtractor; fromFinalChunk?: MetricExtractor; fromResult?: MetricExtractor; getTags?: (request: TRequest) => Record; getTagsFromResult?: TagExtractor; } export interface DownloadAssetProfilingMeta { sourceType?: string; downloadStats?: DownloadStats; totalDownloadTimeMs?: number; } export declare function registerOperationMetrics(config: OperationMetricsConfig): void; export declare function buildOperationEvent(op: string, profileId: string, ts: number, executionMs: number, request?: unknown, finalResponse?: unknown, ttfb?: number): ProfilingEvent | undefined; //# sourceMappingURL=operation-metrics.d.ts.map