import { Logger, type OperationContext } from '@origintrail-official/dkg-core'; /** Where an unavailable read authority came from, as the agent attributes it. */ export interface ContextGraphReadAuthorityAttribution { readonly source: string; readonly reason: string; readonly dependency: string; } export interface ReadAuthorityDiagnosticsOptions { readonly logger?: Pick; /** Monotonic milliseconds; defaults to `performance.now()`. */ readonly now?: () => number; /** How often one attribution may raise a warning. */ readonly intervalMs?: number; /** How many attributions are remembered at once, least recently warned first out. */ readonly cacheMax?: number; } export interface ReadAuthorityDiagnostics { /** Logs one line for a read-authority 503 under `ctx`'s operation id. */ record(ctx: OperationContext, attribution: ContextGraphReadAuthorityAttribution): void; } /** * Server-side attribution for read-authority 503s (#2834): the authority * source, its reason and the dependency that could not answer (store, chain, * local state or unknown). Every 503 gets exactly one line under its own * operation id, so the id a response carries can always be found. The first * 503 of an attribution in a window is a warning, which reports how many * repeats it held back since the previous one; repeats in between are info * lines. Only attribution tokens are logged, never graph ids, callers or raw * dependency errors. */ export declare function createReadAuthorityDiagnostics(options?: ReadAuthorityDiagnosticsOptions): ReadAuthorityDiagnostics; //# sourceMappingURL=read-authority-diagnostics.d.ts.map