Skip to content

perf_hooks: make the event loop display histogram disposable #58384

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from

Conversation

jasnell
Copy link
Member

@jasnell jasnell commented May 19, 2025

Fairly self-explanatory, but see the test for an example.

@jasnell jasnell requested review from mcollina and anonrig May 19, 2025 01:16
@nodejs-github-bot nodejs-github-bot added the needs-ci PRs that need a full CI run. label May 19, 2025
@jasnell jasnell added semver-minor PRs that contain new features and should be released in the next minor version. dont-land-on-v20.x PRs that should not land on the v20.x-staging branch and should not be released in v20.x. dont-land-on-v22.x PRs that should not land on the v22.x-staging branch and should not be released in v22.x. dont-land-on-v23.x PRs that should not land on the v23.x-staging branch and should not be released in v23.x. and removed needs-ci PRs that need a full CI run. labels May 19, 2025
@nodejs-github-bot

This comment was marked as outdated.

Copy link

codecov bot commented May 19, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 90.21%. Comparing base (33505d1) to head (4381c85).
Report is 15 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #58384      +/-   ##
==========================================
+ Coverage   90.19%   90.21%   +0.01%     
==========================================
  Files         635      635              
  Lines      187241   187246       +5     
  Branches    36768    36767       -1     
==========================================
+ Hits       168883   168923      +40     
+ Misses      11134    11091      -43     
- Partials     7224     7232       +8     
Files with missing lines Coverage Δ
lib/internal/perf/event_loop_delay.js 95.83% <100.00%> (+0.22%) ⬆️

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

This comment was marked as outdated.

@jasnell jasnell added the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label May 19, 2025
Copy link
Member

@LiviaMedeiros LiviaMedeiros left a comment

Choose a reason for hiding this comment

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

LGTM.
Same note as #58385 (review): this could be split into two commits for straightforwarder porting to previous release lines.

Copy link
Member

@legendecas legendecas left a comment

Choose a reason for hiding this comment

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

Code-wise LGTM. But I'm not sure how this will be used in real world.

From a quick search (https://github.com/search?type=code&q=%3D+monitorEventLoopDelay+language%3AJavaScript+OR+language%3ATypeScript), I could not reason about which use case can be improved with using histograom = monitorEventLoopDelay(). Usually, a histogram might be closed in a different function scope (e.g. triggered by another event).

Copy link
Member

@mcollina mcollina left a comment

Choose a reason for hiding this comment

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

lgtm

@jasnell jasnell force-pushed the jasnell/eld-histogram-erm branch from 0f65fed to 4381c85 Compare May 24, 2025 23:30
@nodejs-github-bot

This comment was marked as outdated.

@nodejs-github-bot

This comment was marked as outdated.

@LiviaMedeiros LiviaMedeiros added the commit-queue-rebase Add this label to allow the Commit Queue to land a PR in several commits. label May 25, 2025
@nodejs-github-bot
Copy link
Collaborator

nodejs-github-bot commented May 25, 2025

@jasnell jasnell removed the commit-queue-rebase Add this label to allow the Commit Queue to land a PR in several commits. label May 26, 2025
jasnell added a commit that referenced this pull request May 26, 2025
PR-URL: #58384
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: LiviaMedeiros <livia@cirno.name>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
jasnell added a commit that referenced this pull request May 26, 2025
PR-URL: #58384
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: LiviaMedeiros <livia@cirno.name>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
@jasnell
Copy link
Member Author

jasnell commented May 26, 2025

Landed in 73471bd...19e0d47

@jasnell jasnell closed this May 26, 2025
targos pushed a commit that referenced this pull request May 31, 2025
PR-URL: #58384
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: LiviaMedeiros <livia@cirno.name>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
targos pushed a commit that referenced this pull request May 31, 2025
PR-URL: #58384
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: LiviaMedeiros <livia@cirno.name>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
author ready PRs that have at least one approval, no pending requests for changes, and a CI started. dont-land-on-v20.x PRs that should not land on the v20.x-staging branch and should not be released in v20.x. dont-land-on-v22.x PRs that should not land on the v22.x-staging branch and should not be released in v22.x. dont-land-on-v23.x PRs that should not land on the v23.x-staging branch and should not be released in v23.x. 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.

6 participants