Skip to content

[core] add a shared cache statistics counter - #2503

Open
maxkozlovsky wants to merge 1 commit into
mainfrom
max/cache-stats
Open

[core] add a shared cache statistics counter#2503
maxkozlovsky wants to merge 1 commit into
mainfrom
max/cache-stats

Conversation

@maxkozlovsky

Copy link
Copy Markdown
Contributor

Introduce CacheStats, a small always-on counter for hits, misses and evictions, plus the plain snapshot type callers read it through.

Copilot AI lite review requested due to automatic review settings August 20, 2026 22:49

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a small, always-on cache statistics utility to category/core/lru/ so caches can expose consistent hit/miss/eviction counters via a simple snapshot type.

Changes:

  • Introduce CacheStats (atomic counters) and CacheStatsSnapshot (plain readout struct).
  • Add unit tests covering counting behavior and non-consuming reads.
  • Wire the new header into monad_core sources via category/core/CMakeLists.txt.

Verdict: CORRECT

🤖 Generated with Claude Code

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
category/core/lru/cache_stats.hpp Adds CacheStats + CacheStatsSnapshot types for cache counter reporting.
category/core/lru/cache_stats_test.cpp Adds GTest coverage for counter behavior and snapshot semantics.
category/core/CMakeLists.txt Includes the new header in the monad_core object library sources list.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread category/core/lru/cache_stats_test.cpp
Comment thread category/core/lru/cache_stats.hpp Outdated
Introduce CacheStats, a small always-on counter for hits, misses and
evictions, plus the plain snapshot type callers read it through.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
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.

2 participants