Skip to content

perf_hooks: add options to monitorEventLoopDelay() - #66115

Open
jasnell wants to merge 3 commits into
nodejs:mainfrom
jasnell:jasnell/perf-hooks-eld-range-options
Open

jasnell wants to merge 3 commits into
nodejs:mainfrom
jasnell:jasnell/perf-hooks-eld-range-options

Conversation

@jasnell

@jasnell jasnell commented Sep 18, 2026

Copy link
Copy Markdown
Member

Adds options to tune histogram parameters to monitorEventLoopDelay()

Also fix a truncation and doc bug.

`IntervalHistogram` stored the interval as `int32_t`, so a resolution
above 2^31 - 1 ms wrapped: `resolution: 2 ** 32 + 1` sampled every
millisecond.

Signed-off-by: James M Snell <jasnell@gmail.com>
Assisted-by: OpenCode
It counts values above the highest recordable value, for every
histogram type. Event loop delay histograms no longer have a 1 hour
limit.

Signed-off-by: James M Snell <jasnell@gmail.com>
Refs: nodejs#41153
Assisted-by: OpenCode
Accept `lowest`, `highest`, and `figures`, as `createHistogram()`
does. The defaults are unchanged, and use up to 432 KiB per histogram.

Signed-off-by: James M Snell <jasnell@gmail.com>
Assisted-by: OpenCode
@jasnell jasnell added semver-minor PRs that contain new features and should be released in the next minor version. perf_hooks Issues and PRs related to the perf_hooks module and performance measurement APIs. labels Sep 18, 2026
@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 involving general changes in the lib/ or src/ directories. needs-ci PRs that need a full CI run. labels Sep 18, 2026
@codecov

codecov Bot commented Sep 18, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 85.71429% with 7 lines in your changes missing coverage. Please review.
✅ Project coverage is 90.27%. Comparing base (dd5dfb5) to head (ca68db9).

Files with missing lines Patch % Lines
src/node_perf.cc 58.82% 0 Missing and 7 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #66115      +/-   ##
==========================================
- Coverage   90.27%   90.27%   -0.01%     
==========================================
  Files         790      790              
  Lines      271651   271690      +39     
  Branches    51842    51848       +6     
==========================================
+ Hits       245228   245257      +29     
- Misses      16928    16935       +7     
- Partials     9495     9498       +3     
Files with missing lines Coverage Δ
lib/internal/histogram.js 97.23% <100.00%> (+<0.01%) ⬆️
lib/internal/perf/event_loop_delay.js 95.90% <100.00%> (+1.00%) ⬆️
src/histogram.cc 85.53% <100.00%> (-0.15%) ⬇️
src/histogram.h 84.31% <ø> (ø)
src/node_perf.cc 85.39% <58.82%> (-1.96%) ⬇️

... and 17 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.

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 involving general changes in the lib/ or src/ directories. needs-ci PRs that need a full CI run. perf_hooks Issues and PRs related to the perf_hooks module and performance measurement APIs. semver-minor PRs that contain new features and should be released in the next minor version.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants