Skip to content

perf_hooks: add idleTime and event loop util

Rodrigo Muino Tomonari requested to merge github/fork/trevnorris/idle-time into master

Use uv_metrics_idle_time() to return a high resolution millisecond timer of the amount of time the event loop has been idle since it was initialized.

Include performance.eventLoopUtilization() API to handle the math of calculating the idle and active times. This has been added to prevent accidental miscalculations of the event loop utilization. Such as not taking into consideration offsetting nodeTiming.loopStart or timing differences when being called from a Worker thread.

  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • documentation is changed or added
  • commit message follows commit guidelines

On the side, is v12.x going to receive the libuv v1.39.0 update so we can backport this?

Merge request reports

Loading