Skip to content

[v24.x backport] perf_hooks: sample delay per event loop iteration#64480

Open
pabloerhard wants to merge 2 commits into
nodejs:v24.x-stagingfrom
pabloerhard:backport-62935-to-v24.x
Open

[v24.x backport] perf_hooks: sample delay per event loop iteration#64480
pabloerhard wants to merge 2 commits into
nodejs:v24.x-stagingfrom
pabloerhard:backport-62935-to-v24.x

Conversation

@pabloerhard

Copy link
Copy Markdown
Contributor

Add a samplePerIteration option to monitorEventLoopDelay that records event loop delay from libuv event loop iterations instead of the timer interval sampler. The default remains interval-based; existing uses of monitorEventLoopDelay() keep behaving the same unless the samplePerIteration option is passed through.

PR-URL: #62935
Reviewed-By: Bryan English [email protected]
Reviewed-By: Ruben Bridgewater [email protected]
Reviewed-By: James M Snell [email protected]

@nodejs-github-bot nodejs-github-bot added c++ Issues and PRs that require attention from people who are familiar with C++. lib / src Issues and PRs related to general changes in the lib or src directory. needs-ci PRs that need a full CI run. v24.x Issues that can be reproduced on v24.x or PRs targeting the v24.x-staging branch. labels Jul 13, 2026
Add a samplePerIteration option to monitorEventLoopDelay that records
event loop delay from libuv event loop iterations instead of the timer
interval sampler. The default remains interval-based; existing uses of
monitorEventLoopDelay() keep behaving the same unless the
samplePerIteration option is passed through.

Signed-off-by: Pablo Erhard <[email protected]>
PR-URL: nodejs#62935
Reviewed-By: Bryan English <[email protected]>
Reviewed-By: Ruben Bridgewater <[email protected]>
Reviewed-By: James M Snell <[email protected]>
@pabloerhard
pabloerhard force-pushed the backport-62935-to-v24.x branch from 81e3834 to e5cc439 Compare July 13, 2026 19:53
@codecov

codecov Bot commented Jul 13, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 82.83582% with 23 lines in your changes missing coverage. Please review.
✅ Project coverage is 89.88%. Comparing base (b881658) to head (e043837).
⚠️ Report is 406 commits behind head on v24.x-staging.

Files with missing lines Patch % Lines
src/histogram.cc 84.29% 9 Missing and 10 partials ⚠️
src/histogram.h 0.00% 4 Missing ⚠️
Additional details and impacted files
@@                Coverage Diff                @@
##           v24.x-staging   #64480      +/-   ##
=================================================
- Coverage          89.92%   89.88%   -0.04%     
=================================================
  Files                686      694       +8     
  Lines             208389   212192    +3803     
  Branches           40077    40693     +616     
=================================================
+ Hits              187387   190734    +3347     
- Misses             13238    13575     +337     
- Partials            7764     7883     +119     
Files with missing lines Coverage Δ
lib/internal/perf/event_loop_delay.js 95.95% <100.00%> (+0.12%) ⬆️
src/node_perf.cc 86.66% <100.00%> (+0.28%) ⬆️
src/histogram.h 50.00% <0.00%> (-10.00%) ⬇️
src/histogram.cc 81.27% <84.29%> (+2.26%) ⬆️

... and 210 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

aduh95 pushed a commit that referenced this pull request Jul 21, 2026
Add a samplePerIteration option to monitorEventLoopDelay that records
event loop delay from libuv event loop iterations instead of the timer
interval sampler. The default remains interval-based; existing uses of
monitorEventLoopDelay() keep behaving the same unless the
samplePerIteration option is passed through.

Signed-off-by: Pablo Erhard <[email protected]>
PR-URL: #62935
Backport-PR-URL: #64480
Reviewed-By: Antoine du Hamel <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

c++ Issues and PRs that require attention from people who are familiar with C++. lib / src Issues and PRs related to general changes in the lib or src directory. needs-ci PRs that need a full CI run. v24.x Issues that can be reproduced on v24.x or PRs targeting the v24.x-staging branch.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants