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

Open
wants to merge 1 commit into
base: main
Choose a base branch
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.23%. Comparing base (20c4b80) to head (0f65fed).

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #58384      +/-   ##
==========================================
- Coverage   90.23%   90.23%   -0.01%     
==========================================
  Files         633      633              
  Lines      186883   186888       +5     
  Branches    36695    36690       -5     
==========================================
+ Hits       168632   168636       +4     
- Misses      11040    11047       +7     
+ Partials     7211     7205       -6     
Files with missing lines Coverage Δ
lib/internal/perf/event_loop_delay.js 95.83% <100.00%> (+0.22%) ⬆️

... and 18 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
Collaborator

@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).

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.

5 participants