export interface IMetricsService { /** * Initializes the metrics service with the collector endpoint */ initialize(): void; /** * Increments a counter metric * @param name - Name of the counter * @param value - Value to add (default: 1) * @param attributes - Optional attributes */ incrementCounter(name: string, value?: number, attributes?: Record): void; /** * Records a histogram value (for latencies, sizes, etc.) * @param name - Name of the histogram * @param value - Value to record * @param attributes - Optional attributes */ recordHistogram(name: string, value: number, attributes?: Record): void; /** * Sets a gauge value (for current state values) * @param name - Name of the gauge * @param value - Current value * @param attributes - Optional attributes */ setGauge(name: string, value: number, attributes?: Record): void; /** * Records operation duration automatically * @param name - Name of the operation * @param fn - Function to measure * @param attributes - Optional attributes */ measureDuration(name: string, fn: () => T | Promise, attributes?: Record): Promise; /** * Forces flush of metrics */ flush(): Promise; /** * Cleans up resources */ cleanup(): Promise; /** * Record a successful capture */ recordCapture(side: 'front' | 'back', mode: 'auto' | 'manual', durationMs: number): void; /** * Record an error */ recordError(errorType: string, operation: string): void; /** * Record model load performance */ recordModelLoad(modelType: 'detection' | 'classification', durationMs: number, cached: boolean): void; /** * Record detection performance */ recordDetection(durationMs: number, detectionsFound: number): void; /** * Record image size */ recordImageSize(side: 'front' | 'back', sizeBytes: number): void; /** * Update active sessions count */ updateActiveSessions(count: number): void; /** * Record user interaction */ recordUserInteraction(interactionType: string): void; }