export type MetricsCollectorInstance = InstanceType; /** * MetricsCollector class handles metrics collection using prom-client and performance hooks. */ export declare class MetricsCollector { #private; /** * Creates a MetricsCollector instance with prefixed metrics. * @param [prefix='pepr'] - The prefix for the metric names. */ constructor(prefix?: string); addCounter: (name: string, help: string) => void; addSummary: (name: string, help: string) => void; addGauge: (name: string, help: string, labelNames?: string[]) => void; incCounter: (name: string) => void; incGauge: (name: string, labels?: Record, value?: number) => void; /** * Increments the error counter. */ error: () => void; /** * Increments the alerts counter. */ alert: () => void; /** * Observes the duration since the provided start time and updates the summary. * @param startTime - The start time. * @param name - The metrics summary to increment. */ observeEnd: (startTime: number, name?: string) => void; /** * Fetches the current metrics from the registry. * @returns The metrics. */ getMetrics: () => Promise; /** * Returns the current timestamp from performance.now() method. Useful for start timing an operation. * @returns The timestamp. */ static observeStart(): number; /** * Increments the cache miss gauge for a given label. * @param label - The label for the cache miss. */ incCacheMiss: (window: string) => void; /** * Increments the retry count gauge. * @param count - The count to increment by. */ incRetryCount: (count: number) => void; /** * Initializes the cache miss gauge for a given label. * @param label - The label for the cache miss. */ initCacheMissWindow: (window: string) => void; } export declare const metricsCollector: MetricsCollectorInstance; //# sourceMappingURL=metrics.d.ts.map