/** Sampling interval of the event loop delay histogram. */ export declare const EVENT_LOOP_RESOLUTION_MS = 20; /** Every rotation drops the older half, so a report covers the last 30 to 60 s. */ export declare const EVENT_LOOP_ROTATION_MS = 30000; export interface EventLoopDelay { /** Longest delay seen in the window, in ms, sampling interval removed. */ maxMs: number; p99Ms: number; /** Length of the window the values cover. */ windowMs: number; } export interface EventLoopMonitor { read(): EventLoopDelay | undefined; stop(): void; } export interface EventLoopMonitorOptions { /** Injectable clock for tests. */ now?: () => number; /** How often the older histogram is cleared and reused. */ rotateEveryMs?: number; } /** The histogram records the time between samples, so an idle loop reads one sampling interval. */ export declare const toDelayMs: (nanoseconds: number) => number; /** * A starved process fires timers late, so an acquire can time out even though the database * answered. Two histograms take turns so a report covers the last one to two rotation periods, * not everything since the process started. Neither the histograms nor the rotation timer keep * the process alive. */ export declare const createEventLoopMonitor: ({ now, rotateEveryMs, }?: EventLoopMonitorOptions) => EventLoopMonitor; //# sourceMappingURL=event-loop.d.ts.map