You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Negative utilization in eventLoopUtilization for worker_threads #40525
How often does it reproduce? Is there a required condition?
If worker event loop is empty in delta calculation period.
What is the expected behavior?
Delta fields active and utilization are expected to be positive, utilization expected to be [0..1].
What do you see instead?
Negative values in ~50% cases. But if you add setInterval with empty handler for minimum eventloop load, utilization will be always between 0 and 1.
Additional information
I know that it is a stable API but it would be better in far future:
I'd propose to reduce time between loopIdleTime() call and now() in lower level, but my experiments in this field is not successful, still getting negative utilization.
To decompose this function to respect separation of concerns into performance.eventLoopUsage(): EventLoopUsage and performance.eventLoopUtilization(usage1, usage2): EventLoopUtilization.
Now we have 6 places to calculate proportion (for utilization), 3 in internal/worker.js and 3 in internal/perf/event_loop_utilization.js.
This issue has been marked as stale due to 210 days of inactivity.
It will be automatically closed in 30 days if no further activity occurs. If this is still relevant, please leave a comment or update it to keep it open.
This issue has been automatically closed after 30 days of inactivity following its stale status (no activity for a total of 120 days).
If this is still relevant, feel free to reopen it or leave a comment with additional details so we can continue the discussion.
Activity
tshemsedinov commentedon Oct 19, 2021
Refs: #35664
Refs: #37134
FYI: @trevnorris and @addaleax
trevnorris commentedon Oct 26, 2021
Thanks. I'll give it a look.
github-actions commentedon Jun 26, 2026
This issue has been marked as stale due to 210 days of inactivity.
It will be automatically closed in 30 days if no further activity occurs. If this is still relevant, please leave a comment or update it to keep it open.
github-actions commentedon Jul 27, 2026
This issue has been automatically closed after 30 days of inactivity following its stale status (no activity for a total of 120 days).
If this is still relevant, feel free to reopen it or leave a comment with additional details so we can continue the discussion.