Skip to main content

Module github_metrics

Module github_metrics 

Source
Expand description

Counting every GitHub API invocation omni-dev makes (#1387).

Every GitHub call funnels through the gh CLI subprocess (ADR-0003 / ADR-0050 — the token never enters our process), so there is no in-process HTTP transport to instrument. Instead, run_gh is the single choke point every Rust gh call site routes through: it spawns gh, records one kind: "gh" line to the request log (crate::request_log::record_gh), and returns the process Output unchanged so call-site behavior and exit codes are untouched.

aggregate reads those records back and tallies them by category, subcommand, and source. It is the shared backend for omni-dev log count --kind gh, the daemon’s periodic/shutdown summaries, and daemon status.

Structs§

GhCounts
Tallies of gh invocations over a time window, broken down three ways.

Enums§

Category
Whether a gh invocation hit the GitHub API, and how.

Functions§

aggregate
Aggregates gh records from the request log at path within the optional [since, until] window and (optionally) restricted to one source.
run_gh
Runs one gh invocation through the choke point, recording a kind: "gh" request-log line for it.
source_str
Lowercase name of a Source for display / JSON map keys.