Skip to content

Commit 7fd7686

Browse files
committed
Add comprehensive cache statistics
The `CacheStats` class provides detailed metrics like hit/miss counts, load success/failure counts, total load time, and eviction counts. It also offers derived metrics such as hit/miss rates, load failure rate, and average load penalty. The design is inspired by Caffeine. `BasicClientSideCache` now uses a `StatsCounter` to accumulate these statistics, exposed via a new `stats()` method. The previous `cacheHits()` and `cacheMisses()` methods have been removed. A `recordStats` option (default: true) in `ClientSideCacheConfig` allows disabling statistics collection.
1 parent 49fb5c9 commit 7fd7686

File tree

3 files changed

+774
-107
lines changed

3 files changed

+774
-107
lines changed

0 commit comments

Comments
 (0)