Skip to content

Direct mode stats - #2844

Open
badumbatish wants to merge 3 commits into
mozilla:mainfrom
badumbatish:direct_mode_stats
Open

Direct mode stats#2844
badumbatish wants to merge 3 commits into
mozilla:mainfrom
badumbatish:direct_mode_stats

Conversation

@badumbatish

@badumbatish badumbatish commented Sep 10, 2026

Copy link
Copy Markdown

Add statistics for direct mode.

This allows downstream users to inspect how efficient the direct mode caching is. My downstream work would also benefit from some form of direct mode statistics for our testing

See the new form of show-stats

Compile requests                      3
Compile requests executed             0
Cache hits                            0
Direct cache hits                     0
Cache misses                          0
Direct cache hits                     0
Cache hits rate                       -
Direct cache hits rate                -
Cache timeouts                        0
Cache read errors                     0
Forced recaches                       0
Cache write errors                    0
Cache errors                          0
Compilations                          0
Compilation failures                  0
Non-cacheable compilations            0
Non-cacheable calls                   0
Non-compilation calls                 3
Unsupported compiler calls            0
Average cache write               0.000 s
Average compiler                  0.000 s
Average cache read hit            0.000 s
Failed distributed compilations       0
Cache location                  Local disk: "/home/jjasmine/.cache/sccache"
Base directories                (none)
Use direct/preprocessor mode?   yes
Version (client)                0.17.0
Max cache size                       10 GiB

No AI is used for this PR

See the following:
```
sccache on  direct_mode_stats is 📦 v0.17.0 via 🦀 v1.97.1 via ❄️  impure (sccache-dev-env) took 2s
➜ ./target/debug/sccache --show-stats
[2026-09-10 15:58:34]
Compile requests                      3
Compile requests executed             0
Cache hits                            0
Direct cache hits                     0
Cache misses                          0
Direct cache hits                     0
Cache hits rate                       -
Direct cache hits rate                -
Cache timeouts                        0
Cache read errors                     0
Forced recaches                       0
Cache write errors                    0
Cache errors                          0
Compilations                          0
Compilation failures                  0
Non-cacheable compilations            0
Non-cacheable calls                   0
Non-compilation calls                 3
Unsupported compiler calls            0
Average cache write               0.000 s
Average compiler                  0.000 s
Average cache read hit            0.000 s
Failed distributed compilations       0
Cache location                  Local disk: "/home/jjasmine/.cache/sccache"
Base directories                (none)
Use direct/preprocessor mode?   yes
Version (client)                0.17.0
Max cache size                       10 GiB
```
@codecov-commenter

codecov-commenter commented Sep 11, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 93.61702% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 71.83%. Comparing base (46e96ab) to head (45d8ca9).
⚠️ Report is 17 commits behind head on main.

Files with missing lines Patch % Lines
src/compiler/compiler.rs 78.57% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2844      +/-   ##
==========================================
- Coverage   72.90%   71.83%   -1.07%     
==========================================
  Files          72       72              
  Lines       37275    38834    +1559     
==========================================
+ Hits        27176    27898     +722     
- Misses      10099    10936     +837     

☔ 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.

Comment thread src/compiler/c.rs
env_vars,
}),
weak_toolchain_key,
hash_key_type: match needs_preprocessing {

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.

can we do a if instead of a match ? thanks

@sylvestre

Copy link
Copy Markdown
Collaborator

and please fix

error: all variants have the same prefix: `Direct`
    --> src/compiler/compiler.rs:1207:1
     |
1207 | / pub enum CacheType {
1208 | |     DirectHit,
1209 | |     DirectMiss,
1210 | |     DirectNotAttempted,
1211 | | }
     | |_^
     |


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.

3 participants