Skip to content

cache: record per-level stats for client-side raw reads - #2915

Merged
sylvestre merged 2 commits into
mozilla:mainfrom
codeandsolder:upstream-pr/client-side-multilevel-stats
Oct 19, 2026
Merged

sylvestre merged 2 commits into
mozilla:mainfrom
codeandsolder:upstream-pr/client-side-multilevel-stats

Conversation

@codeandsolder

Copy link
Copy Markdown
Contributor

Fixes #2804.

Summary

  • record per-level hit/miss/read timing for client-side multi-level raw reads
  • keep parsed and raw read accounting on the same helpers
  • preserve aggregate cache statistics while making L0/L1 accounting visible in client-side mode

Validation

  • full Rust 1.99 library suite: 576 passed, 0 failed
  • focused Rust 1.99 regression covers per-level raw-read statistics
  • cargo fmt and git diff --check
  • Mozilla Rust 1.91 exact CI Clippy gate passes

@codecov-commenter

codecov-commenter commented Oct 18, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 97.61905% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 78.19%. Comparing base (1bd7432) to head (26d8802).
⚠️ Report is 6 commits behind head on main.

Files with missing lines Patch % Lines
src/cache/multilevel.rs 92.30% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2915      +/-   ##
==========================================
+ Coverage   78.06%   78.19%   +0.13%     
==========================================
  Files          73       74       +1     
  Lines       43233    43396     +163     
==========================================
+ Hits        33749    33933     +184     
+ Misses       9484     9463      -21     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@codeandsolder-git-wrangler
codeandsolder-git-wrangler Bot force-pushed the upstream-pr/client-side-multilevel-stats branch from 5512028 to e65dd2f Compare October 18, 2026 09:10
Comment thread src/cache/multilevel.rs Outdated
for level in &self.levels {
for (idx, level) in self.levels.iter().enumerate() {
let start = Instant::now();
if let Some(bytes) = level.get_raw(key).await? {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

with ? an error on L0 returns early and records nothing, while get() counts it as a miss and tries the next level. is that intended?

@sylvestre
sylvestre merged commit 11bda59 into mozilla:main Oct 19, 2026
51 checks passed
@sylvestre

Copy link
Copy Markdown
Collaborator

Thanks for your PR

@codeandsolder-git-wrangler
codeandsolder-git-wrangler Bot deleted the upstream-pr/client-side-multilevel-stats branch October 26, 2026 02:26
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.

When using SCCACHE_CLIENT_SIDE the stats report is not properly populated

3 participants