On this page

C

ELDHistogram extends Histogram

History

A Histogram that records event loop delay, returned by perf_hooks.monitorEventLoopDelay().

M

histogram.disable

History
histogram.disable(): boolean
Returns:boolean

Disables event loop delay sampling. Returns true if sampling was stopped, false if it was already stopped.

M

histogram.enable

History
histogram.enable(): boolean
Returns:boolean

Enables event loop delay sampling. Returns true if sampling was started, false if it was already started.

M

histogram[Symbol.dispose]

History
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.