Skip to content

feat(store): expose cache hit ratio metric - #410

Open
loglapa wants to merge 1 commit into
celestiaorg:mainfrom
loglapa:feat/store-cache-metrics-233
Open

feat(store): expose cache hit ratio metric#410
loglapa wants to merge 1 commit into
celestiaorg:mainfrom
loglapa:feat/store-cache-metrics-233

Conversation

@loglapa

@loglapa loglapa commented Aug 22, 2026

Copy link
Copy Markdown

Closes #233

Overview

  • expose hdr_store_cache_hit_ratio_gauge as a dimensionless 0..1 ratio
  • count only reads actually served by the in-memory cache or datastore, excluding pending writes
  • add focused miss-then-hit coverage

Validation

  • go test ./store -count=1
  • go test -race ./store -run TestStore_CacheHitRatio -count=1
  • golangci-lint run ./store

The full go test ./... run also reaches an unrelated existing panic in TestExchangeServer_partialRangeNotExpanded; the changed store package and focused race test pass.

Signed-off-by: Vladislav Lapin <v.lapin@scalablesolutions.io>
@loglapa
loglapa marked this pull request as ready for review August 22, 2026 11:59
@loglapa
loglapa requested a review from a team as a code owner August 22, 2026 11:59
@loglapa
loglapa requested a review from renaynay August 22, 2026 11:59
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.

store: add metric to track how often a Get request is retrieved from cache rather than read from disk

1 participant