You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fetch_duration histogram is never recorded, and failed diffs are left out of the cache hit/miss ratio #73
Design spec (it lives in GitLfsCache, where it was written): https://github.com/ktsu-dev/GitLfsCache/blob/4f67a33a5218f991784698181030e9eb5a2fc9ae/docs/superpowers/specs/2026-08-19-gitbranchstatecache-design.md#L221-L223
A ktsu.GitBranchStateCache meter: state requests, diff cache hits and misses, fetches, fetch failures, fetch duration, diff computation duration, … The ratio to watch is diff cache hits against misses …
What exists today
GitBranchStateCache/Observability/BranchStateMetrics.cs:75 creates the gitbranchstatecache.fetch_duration histogram, and :134 defines RecordFetchDuration(string upstream, TimeSpan elapsed).
Nothing calls RecordFetchDuration. A repo-wide grep finds only the definition. MirrorFetcher.CloneAsync (Mirrors/MirrorFetcher.cs:~124-188) and FetchAsync (~190-226) never time their git call.
DiffCache.ComputeAsync (Diffs/DiffCache.cs:~228-231) counts a diff that fails or times out only in diff_failures, never in diff_cache_misses.
Why it matters
A dashboard or alert on fetch latency shows nothing, even after clones and fetches run. Checked with a MeterListener on fetch_duration: recorded=0 after a request that ran a clone.
The README names the hit/miss ratio as the one to watch. Because failed diffs aren't counted as misses, that ratio leaves out the slowest, most expensive diffs, which are exactly the ones that matter, so it looks healthier than it is.
Acceptance criteria
Clone and fetch each record fetch_duration, tagged with the upstream, on success and on failure or timeout. Optionally add a kind=clone|fetch tag.
A diff computation that fails or times out counts as a cache miss as well as a failure.
Tests with a MeterListener assert that both are recorded, for example with ScriptedGit running one clone and one fetch, plus one timed-out diff.
Activity
matt-edmondson commentedon Oct 6, 2026
Triage
Observability/BranchStateMetrics.cs,Mirrors/MirrorFetcher.cs,Diffs/DiffCache.cs).Generated by Claude Code