UNPKG

@phren/cli

Version:

Knowledge layer for AI agents - CLI, MCP server, and data layer

32 lines (31 loc) • 1.4 kB
/** * In-memory Hook counters: Herdr RPCs by method, process identity probes, * git child processes, timer ticks and SSH logins to peers by name. Counting is an integer add on * a Map entry, so the hot paths stay as they were. Nothing here is persisted * and names come from the Hook's own code, never from a request. */ export type MetricKind = "herdr" | "identity" | "git" | "timer" | "peer"; export declare class HookMetrics { private readonly now; private readonly counters; readonly startedAt: number; constructor(now?: () => number); count(kind: MetricKind, name: string): void; /** * Totals since start, the last complete minute, the minute in progress and * the average per minute since start, for each counted name. */ snapshot(): Json; private minute; private roll; } type Json = Record<string, unknown>; /** The Hook process's counters. */ export declare const hookMetrics: HookMetrics; export declare const countHerdr: (method: string) => void; export declare const countIdentity: (probe: string) => void; export declare const countGit: (caller: string) => void; export declare const countTick: (timer: string) => void; /** One SSH login to a peer, by route (`v1.conductor`), or a read answered without one (`saved.offline`, `saved.shared`, `saved.cached`). */ export declare const countPeer: (name: string) => void; export {};