export interface EventLoopLagSnapshot { /** 99th-percentile loop delay in ms over the current window. */ p99Ms: number; /** Mean loop delay in ms over the current window. */ meanMs: number; /** Worst single delay in ms over the current window. */ maxMs: number; /** Epoch ms when the current window started (last reset / enable). */ windowStartedAt: number; } export interface EventLoopLagMonitor { snapshot(): EventLoopLagSnapshot; /** Start a fresh window: clears the histogram, restamps windowStartedAt. */ reset(): void; /** Stop sampling (shutdown). Idempotent. */ disable(): void; } /** Minimal structural seam so tests can inject a fake histogram with * controlled percentiles instead of loading the real loop. Matches the * subset of IntervalHistogram this module reads. */ export interface HistogramLike { enable(): void; disable(): void; reset(): void; percentile(p: number): number; mean: number; max: number; } export declare function createEventLoopLagMonitor(histogram?: HistogramLike, now?: () => number): EventLoopLagMonitor;