Skip to content

fix(metrics): repair shadow-cache comparison and export Prometheus data - #19

Merged
kclaka merged 1 commit into
cache-capacity-safetyfrom
cache-comparison-metrics
Sep 16, 2026
Merged

kclaka merged 1 commit into
cache-capacity-safetyfrom
cache-comparison-metrics

Conversation

@kclaka

@kclaka kclaka commented Sep 16, 2026 •

Copy link
Copy Markdown
Owner

A primary hit with a shadow miss never populated the shadow cache; primary misses also replaced existing shadow hits. This biased the advertised same-traffic policy comparison. Populate shadow misses from primary hits and inspect shadow entries without counting another request or changing eviction state before insertion.

Export real Prometheus cache counters and size/capacity gauges with policy and role labels. Calculate throughput from elapsed time, reset baselines when cache instances change, and preserve monotonic exported counters. Document that throughput counts cache lookups and remove claims for unimplemented latency histograms.

PR #7 (cache capacity/safety) has already been merged into the branch for #14. This PR retains cache-capacity-safety as its base. Its diff contains only comparison and observability changes.

Validation: 62 Rust tests (including prerequisites), with five comparison/metrics regressions; cargo fmt; strict Clippy across all targets. Tests cover both directions of cache divergence, bench-mode isolation, elapsed-time throughput, and rendered Prometheus output. The combined runtime smoke check verified the live metrics endpoint.

Replaces #13 after removing the codex/ branch prefix. Commit contents are preserved; the original PR retains prior discussion and review history.

@kclaka
kclaka merged commit 2a5d689 into cache-capacity-safety Sep 16, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant