[core] add a shared cache statistics counter - #2503
Open
maxkozlovsky wants to merge 1 commit into
Open
Conversation
Contributor
There was a problem hiding this comment.
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) andCacheStatsSnapshot(plain readout struct). - Add unit tests covering counting behavior and non-consuming reads.
- Wire the new header into
monad_coresources viacategory/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.
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>
maxkozlovsky
force-pushed
the
max/cache-stats
branch
from
August 20, 2026 23:18
b7073e4 to
3cd8e6e
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Introduce CacheStats, a small always-on counter for hits, misses and evictions, plus the plain snapshot type callers read it through.