@@ -1926,6 +1926,9 @@ are not guaranteed to reflect any correct state of the event loop.
19261926<!-- YAML
19271927added: v11.10.0
19281928changes:
1929+ - version: REPLACEME
1930+ pr-url: https://github.com/nodejs/node/pull/66115
1931+ description: Added the `lowest`, `highest`, and `figures` options.
19291932 - version: v26.5.0
19301933 pr-url: https://github.com/nodejs/node/pull/62935
19311934 description: Added the `samplePerIteration` option.
@@ -1937,6 +1940,14 @@ changes:
19371940 * ` resolution ` {number} The sampling rate in milliseconds for interval-based
19381941 sampling. Must be greater than zero. This option is ignored when
19391942 ` samplePerIteration ` is ` true ` . ** Default:** ` 10 ` .
1943+ * ` lowest ` {number|bigint} The lowest discernible delay, in nanoseconds. Must
1944+ be an integer value greater than ` 0 ` . ** Default:** ` 1 ` when
1945+ ` samplePerIteration ` is ` true ` , otherwise ` 1000 ` .
1946+ * ` highest ` {number|bigint} The highest recordable delay, in nanoseconds.
1947+ Must be an integer value that is equal to or greater than two times
1948+ ` lowest ` . ** Default:** ` 2n ** 63n - 1n ` .
1949+ * ` figures ` {number} The number of accuracy digits. Must be an integer
1950+ between ` 1 ` and ` 5 ` . ** Default:** ` 3 ` .
19401951* Returns: {ELDHistogram}
19411952
19421953_ This property is an extension by Node.js. It is not available in Web browsers._
@@ -1952,6 +1963,16 @@ the application is idle.
19521963The two sampling modes produce significantly different results and should not
19531964be compared directly.
19541965
1966+ The ` lowest ` , ` highest ` , and ` figures ` options configure the histogram as they
1967+ do for [ ` perf_hooks.createHistogram() ` ] [ ] . ` lowest ` must be greater than ` 0 `
1968+ because an event loop delay of zero is not possible: the event loop has a
1969+ minimal overhead, and the measurement itself depends on the event loop turning.
1970+ Delays greater than ` highest ` are not recorded, and are counted by
1971+ [ ` histogram.exceeds ` ] [ ] instead. With interval-based sampling, every sample
1972+ includes the ` resolution ` , so ` highest ` should be well above
1973+ ` resolution * 1e6 ` . The histogram's memory use depends on these options, not
1974+ on the number of samples.
1975+
19551976``` mjs
19561977import { monitorEventLoopDelay } from ' node:perf_hooks' ;
19571978
@@ -2239,8 +2260,8 @@ added: v11.10.0
22392260
22402261* Type: {number}
22412262
2242- The number of times the event loop delay exceeded the maximum 1 hour event
2243- loop delay threshold .
2263+ The number of values that were not recorded because they exceeded the
2264+ histogram's highest recordable value .
22442265
22452266### ` histogram.exceedsBigInt `
22462267
@@ -2252,8 +2273,8 @@ added:
22522273
22532274* Type: {bigint}
22542275
2255- The number of times the event loop delay exceeded the maximum 1 hour event
2256- loop delay threshold .
2276+ The number of values that were not recorded because they exceeded the
2277+ histogram's highest recordable value .
22572278
22582279### ` histogram.export() `
22592280
@@ -3392,7 +3413,9 @@ dns.promises.resolve('localhost');
33923413[ `'exit'` ] : process.md#event-exit
33933414[ `child_process.spawnSync()` ] : child_process.md#child_processspawnsynccommand-args-options
33943415[ `histogram.diff()` ] : #histogramdiffother
3416+ [ `histogram.exceeds` ] : #histogramexceeds
33953417[ `histogram.export()` ] : #histogramexport
3418+ [ `perf_hooks.createHistogram()` ] : #perf_hookscreatehistogramoptions
33963419[ `perf_hooks.createSlidingWindowHistogram()` ] : #perf_hookscreateslidingwindowhistogramoptions
33973420[ `perf_hooks.eventLoopUtilization()` ] : #perf_hookseventlooputilizationutilization1-utilization2
33983421[ `perf_hooks.importHistogram()` ] : #perf_hooksimporthistogramdata
0 commit comments