Skip to content

chore: Reduce syscalls in metrics update logic - #2940

Merged
andygrove merged 2 commits into
apache:mainfrom
andygrove:poll-metrics
Dec 19, 2025
Merged

andygrove merged 2 commits into
apache:mainfrom
andygrove:poll-metrics

Conversation

@andygrove

@andygrove andygrove commented Dec 18, 2025 •

Copy link
Copy Markdown
Member

Which issue does this PR close?

Closes #.

Rationale for this change

Reduce syscalls by 99% when checking whether it is time to update metrics (check once per 100 polls instead of on every poll).

What changes are included in this PR?

How are these changes tested?

@codecov-commenter

codecov-commenter commented Dec 18, 2025 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 59.61%. Comparing base (f09f8af) to head (b37eb95).
⚠️ Report is 779 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff              @@
##               main    #2940      +/-   ##
============================================
+ Coverage     56.12%   59.61%   +3.48%     
- Complexity      976     1379     +403     
============================================
  Files           119      167      +48     
  Lines         11743    15430    +3687     
  Branches       2251     2550     +299     
============================================
+ Hits           6591     9198    +2607     
- Misses         4012     4946     +934     
- Partials       1140     1286     +146     

☔ View full report in Codecov by Sentry.
📢 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.

@andygrove
andygrove marked this pull request as ready for review December 19, 2025 00:14
@andygrove
andygrove requested a review from mbutrovich December 19, 2025 00:15

@mbutrovich mbutrovich left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I suspect poll iterations will still be quick, right? We don't have to worry too much about super slow iterations delaying metrics updates? Thanks @andygrove!

@andygrove

Copy link
Copy Markdown
Member Author

I suspect poll iterations will still be quick, right? We don't have to worry too much about super slow iterations delaying metrics updates? Thanks @andygrove!

The worst case is that the UI updates infrequently during execution, but the final metrics will always be updated.

@hsiang-c hsiang-c left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

@andygrove
andygrove merged commit 6ab58cc into apache:main Dec 19, 2025
150 of 151 checks passed
@andygrove
andygrove deleted the poll-metrics branch August 5, 2026 19:57
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.

4 participants