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
ghinvocations over a time window, broken down three ways.
Enums§
- Category
- Whether a
ghinvocation hit the GitHub API, and how.
Functions§
- aggregate
- Aggregates
ghrecords from the request log atpathwithin the optional[since, until]window and (optionally) restricted to onesource. - run_gh
- Runs one
ghinvocation through the choke point, recording akind: "gh"request-log line for it. - source_
str - Lowercase name of a
Sourcefor display / JSON map keys.