Count hits, misses, fetches and transforms as Prometheus counters (closes #311) #328

Merged
clawbot merged 1 commits from issue-311-prometheus-counters into next 2026-10-26 10:20:43 +01:00
1 Commits
Author SHA1 Message Date
sneak 018c12a8d2 Count hits, misses, fetches and transforms as Prometheus counters (closes #311)
check / check (push) Waiting to run
The five counts the cache_stats table held are now Prometheus counters in
memory, as fields of the cache. NewCache makes them and registers them on
the registry it is given. pixad gives it Prometheus' default registry,
which /metrics serves; each test gives it a new one. The Increment methods
add to their cache's counters, so counting makes no database call.

cache_stats, Cache.Stats, Service.Stats, CacheStats and the pending counts
are gone, with their tests. The background goroutine now writes only access
times, and its names say so: StartPendingAccessTimeWrites,
StopPendingAccessTimeWrites and pendingaccesstimes.go. The two stop tests
whose write under way was a count now use access times.

Model: opus-5-5
2026-10-26 09:12:33 +00:00