A Histogram that records event loop delay, returned by
perf_hooks.monitorEventLoopDelay().
histogram.disable(): boolean
Returns:
booleanDisables event loop delay sampling. Returns true if sampling was
stopped, false if it was already stopped.
histogram.enable(): boolean
Returns:
booleanEnables event loop delay sampling. Returns true if sampling was
started, false if it was already started.
histogram[Symbol.dispose](): void
Disables event loop delay sampling when the histogram is disposed.
const { monitorEventLoopDelay } = require('node:perf_hooks'); { using hist = monitorEventLoopDelay({ resolution: 20 }); hist.enable(); // The histogram will be disabled when the block is exited. }
ELDHistogram instances can be cloned via MessagePort. On the receiving end,
the histogram is cloned as a plain Histogram object that does not implement
the enable() and disable() methods.