/** * In-process metrics store for Iranti. * * Lightweight, zero-dependency counter and timer registry for tracking LLM * call volume, cache effectiveness, DB query counts, and latency percentiles. * All data lives in module-level objects and is reset with reset(). Intended * for request-scoped diagnostics (doctor, debug output) — not persistent * monitoring; use an external metrics system for that. * * Key exports: * - inc() — increment a named counter * - timeStart() — record a start timestamp (returns ms) * - timeEnd() — record a duration sample for a named timer * - snapshot() — read current counters and timer stats (count, avg, p95, max) * - reset() — clear all counters and timers (call between tests) */ type CounterName = "llm.calls" | "llm.failures" | "llm.cache_hit" | "llm.cache_miss" | "db.queries" | "librarian.created" | "librarian.updated" | "librarian.rejected" | "librarian.escalated" | "librarian.conflict_multi_step" | "archivist.processed" | "archivist.resolutions_applied"; type TimerName = "attendant.handshake_ms" | "attendant.observe_ms" | "attendant.attend_ms" | "attendant.reconvene_ms" | "librarian.write_ms" | "llm.latency_ms" | "archivist.cycle_ms"; export declare function inc(name: CounterName, by?: number): void; export declare function timeStart(): number; export declare function timeEnd(name: TimerName, startMs: number): void; export declare function snapshot(): { counters: { [x: string]: number; }; timers: { [k: string]: { count: number; avg: number; p95: number; max: number; }; }; }; export declare function reset(): void; export {}; //# sourceMappingURL=metrics.d.ts.map