/** How many refusals a gateway writes one line each in a window. */ export declare const REFUSAL_LINES_PER_WINDOW = 10; /** The window those lines are counted in. */ export declare const REFUSAL_WINDOW_MS = 60000; /** * What a flood of refused requests may cost a chained, retained stream. The * first `limit` refusals in a window are written one line each, as they * happen; the rest are counted by code, and each count is written once when * the window closes. However many requests arrive, and from however many * addresses, a window holds at most `limit` lines and one count per code, * so the stream grows with time and not with a caller's rate. A window * opens at the first refusal after the last one closed, and closes on a * timer that never holds the process open, or when the owner flushes it. */ export declare class RefusalSampler { private readonly write; private readonly summarize; private readonly limit; private readonly windowMs; private written; private readonly suppressed; private timer; constructor(write: (code: Code) => void, summarize: (code: Code, count: number) => void, limit?: number, windowMs?: number); refuse(code: Code): void; /** Closes the window now: each count is written, and the next refusal opens another. */ flush(): void; } //# sourceMappingURL=RefusalSampler.d.ts.map