-
Notifications
You must be signed in to change notification settings - Fork 29.6k
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
perf_hooks: introduce monitorEventLoopIdleness
#31992
Conversation
NOTE: might need a rebase over #31988 once it lands |
Yeah, I would suggest rebasing it now – it looks like the difference between now and after the rebase would be substantial… |
Separating this out from the QUIC PR to allow it to be separately reviewed. The QUIC implementation makes use of the hdr_histogram for dynamic performance monitoring. This introduces a BaseObject class that allows the internal histograms to be accessed on the JavaScript side and adds a generic Histogram class that will be used by both QUIC and perf_hooks (for the event loop delay monitoring). Signed-off-by: James M Snell <jasnell@gmail.com>
1caf8ed
to
6eca3b9
Compare
Force-pushed after rebase over #31988. Note that I haven't used |
|
Ah sorry, for a moment I thought |
No problem at all. Perhaps, @jasnell might want to salvage some parts of |
@nodejs/performance |
`perf_hooks.monitorEventLoopIdleness` tracks the time event loop has spent waiting for new IO events (i.e. difference between IO poll start time and IO poll end time). The API is identical to `monitorEventLoopDelay`. NOTE: Some of the trace event names had to be renamed for consistency.
6eca3b9
to
2737598
Compare
HistogramBase is so named because it derives from BaseObject. I'm using it in the QUIC impl to record a few different stats but it doesn't have it's own handle. ELDHistogram derives from HandleWrap because of the timer handle. We can, and likely should come up with better naming but the two are definitely distinct from one another. |
I had to sleep on it to realize that it is completely complementary to the |
Somewhat tangential to this: I think cc @jasnell |
If the accuracy would be better or about the same, and if the implementation is straightforward, then worth exploring. |
Created a PR: #32018 |
perf_hooks.monitorEventLoopIdleness
tracks the time event loop hasspent waiting for new IO events (i.e. difference between IO poll start
time and IO poll end time). The API is identical to
monitorEventLoopDelay
.NOTE: Some of the trace event names had to be renamed for consistency.
Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passescc @jasnell