Export cache, eviction, upstream and transform metrics (closes #85) #353

Merged
clawbot merged 2 commits from issue-85-pixa-metrics into next 2026-11-11 15:57:14 +01:00
2 Commits
Author SHA1 Message Date
sneak fa2ec3da6a Export cache, eviction, upstream and transform metrics (closes #85)
check / check (push) Canceled after 0s
New pixa_ metrics, none with labels:
- source cache hits and misses, counted once per variant made or checked;
  a source whose cached file cannot be used is a miss
- cache usage and limit gauges; usage is set each time eviction reads it
- eviction count and bytes, from the size_bytes the deleted row returns
- upstream fetch duration histogram and fetch error counter
- transform duration histogram and an in-progress gauge, both including
  the wait for a processing slot

Removing a damaged file during reconciliation is not counted as an
eviction. README lists every metric; the metrics config comment now says
the pixa_ metrics are measured whether or not /metrics is served.

Model: opus-5-5
2026-11-11 14:32:38 +00:00
sneak a041e73550 Test the eviction, source cache, upstream and transform metrics
The tests check the metrics on a variant hit, on misses that fetch or use
the cached source, on a failed fetch, and on both kinds of eviction. A
source whose cached file is gone must count as a source cache miss. A
transform waiting for a processing slot must count as in progress. The
tests fail until the metrics exist.

Model: opus-5-5
2026-11-11 14:31:03 +00:00