Skip to content

perf_hooks: add options to monitorEventLoopDelay() - #66115

Merged
nodejs-github-bot merged 4 commits into
nodejs:mainfrom
jasnell:jasnell/perf-hooks-eld-range-options
Sep 27, 2026
Merged

nodejs-github-bot merged 4 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.

@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.37%. Comparing base (9c06dab) to head (0e5e587).
⚠️ Report is 35 commits behind head on main.

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.37%   90.37%   -0.01%     
==========================================
  Files         790      792       +2     
  Lines      274272   275340    +1068     
  Branches    52502    52769     +267     
==========================================
+ Hits       247865   248830     +965     
- Misses      16890    16924      +34     
- Partials     9517     9586      +69     
Files with missing lines Coverage Δ
lib/internal/histogram.js 97.52% <100.00%> (+<0.01%) ⬆️
lib/internal/perf/event_loop_delay.js 95.90% <100.00%> (+1.00%) ⬆️
src/histogram.cc 86.67% <100.00%> (-0.14%) ⬇️
src/histogram.h 84.31% <ø> (ø)
src/node_perf.cc 86.11% <58.82%> (-1.85%) ⬇️

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

`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 force-pushed the jasnell/perf-hooks-eld-range-options branch from ca68db9 to 4fee958 Compare September 25, 2026 23:35
@jasnell
jasnell requested a review from trivikr September 25, 2026 23:36

@mcollina mcollina left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

lgtm

(linting is failing)

@panva panva added the author ready PRs with CI started, the required approvals, and no outstanding review comments. label Sep 26, 2026
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

@panva panva added the commit-queue-rebase PRs the Commit Queue should land as multiple self-contained commits. label Sep 26, 2026
@panva panva added commit-queue PRs queued for automated landing through the Commit Queue. and removed commit-queue PRs queued for automated landing through the Commit Queue. labels Sep 26, 2026
Comment thread test/parallel/test-perf-hooks-monitor-event-loop-delay-options.js Outdated
Comment thread doc/api/perf_hooks.md Outdated
Co-authored-by: Filip Skokan <panva.ip@gmail.com>
@jasnell jasnell added commit-queue-squash PRs the Commit Queue should land as one squashed commit. and removed commit-queue-rebase PRs the Commit Queue should land as multiple self-contained commits. labels Sep 26, 2026
@panva panva added the request-ci Add this label to start a Jenkins CI on a PR. Only starts once the PR has an approving review. label Sep 26, 2026
@github-actions github-actions Bot removed the request-ci Add this label to start a Jenkins CI on a PR. Only starts once the PR has an approving review. label Sep 26, 2026
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

@panva panva added the resume-ci Add this label to resume the latest eligible Jenkins CI run on a PR with an approving review. label Sep 27, 2026
@github-actions github-actions Bot removed the resume-ci Add this label to resume the latest eligible Jenkins CI run on a PR with an approving review. label Sep 27, 2026
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

@panva panva added the commit-queue PRs queued for automated landing through the Commit Queue. label Sep 27, 2026
@nodejs-github-bot
nodejs-github-bot merged commit 2ce7a73 into nodejs:main Sep 27, 2026
80 checks passed
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

Landed in 2ce7a73

@nodejs-github-bot nodejs-github-bot removed the commit-queue PRs queued for automated landing through the Commit Queue. label Sep 27, 2026
HoonDongKang pushed a commit to HoonDongKang/node that referenced this pull request Sep 28, 2026
`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
PR-URL: nodejs#66115
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Filip Skokan <panva.ip@gmail.com>
aduh95 pushed a commit that referenced this pull request Sep 28, 2026
`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
PR-URL: #66115
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Filip Skokan <panva.ip@gmail.com>
aduh95 pushed a commit that referenced this pull request Sep 28, 2026
`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
PR-URL: #66115
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Filip Skokan <panva.ip@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

author ready PRs with CI started, the required approvals, and no outstanding review comments. c++ Issues and PRs that require attention from people who are familiar with C++. commit-queue-squash PRs the Commit Queue should land as one squashed commit. 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.

4 participants