doc: fix some nits in perf_hooks
PR-URL: https://github.com/nodejs/node/pull/26022 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Anto Aravinth <anto.aravinth.cse@gmail.com> Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
This commit is contained in:
parent
af83f6af5d
commit
0a4c69a5c5
@ -398,14 +398,14 @@ Returns a list of `PerformanceEntry` objects in chronological order
|
|||||||
with respect to `performanceEntry.startTime` whose `performanceEntry.entryType`
|
with respect to `performanceEntry.startTime` whose `performanceEntry.entryType`
|
||||||
is equal to `type`.
|
is equal to `type`.
|
||||||
|
|
||||||
## monitorEventLoopDelay([options])
|
## perf_hooks.monitorEventLoopDelay([options])
|
||||||
<!-- YAML
|
<!-- YAML
|
||||||
added: REPLACEME
|
added: REPLACEME
|
||||||
-->
|
-->
|
||||||
|
|
||||||
* `options` {Object}
|
* `options` {Object}
|
||||||
* `resolution` {number} The sampling rate in milliseconds. Must be greater
|
* `resolution` {number} The sampling rate in milliseconds. Must be greater
|
||||||
than zero. Defaults to `10`.
|
than zero. **Default:** `10`.
|
||||||
* Returns: {Histogram}
|
* Returns: {Histogram}
|
||||||
|
|
||||||
Creates a `Histogram` object that samples and reports the event loop delay
|
Creates a `Histogram` object that samples and reports the event loop delay
|
||||||
@ -421,7 +421,7 @@ detect.
|
|||||||
const { monitorEventLoopDelay } = require('perf_hooks');
|
const { monitorEventLoopDelay } = require('perf_hooks');
|
||||||
const h = monitorEventLoopDelay({ resolution: 20 });
|
const h = monitorEventLoopDelay({ resolution: 20 });
|
||||||
h.enable();
|
h.enable();
|
||||||
// Do something
|
// Do something.
|
||||||
h.disable();
|
h.disable();
|
||||||
console.log(h.min);
|
console.log(h.min);
|
||||||
console.log(h.max);
|
console.log(h.max);
|
||||||
@ -459,21 +459,30 @@ Enables the event loop delay sample timer. Returns `true` if the timer was
|
|||||||
started, `false` if it was already started.
|
started, `false` if it was already started.
|
||||||
|
|
||||||
#### histogram.exceeds
|
#### histogram.exceeds
|
||||||
|
<!-- YAML
|
||||||
|
added: REPLACEME
|
||||||
|
-->
|
||||||
|
|
||||||
* Value: {number}
|
* {number}
|
||||||
|
|
||||||
The number of times the event loop delay exceeded the maximum 1 hour event
|
The number of times the event loop delay exceeded the maximum 1 hour event
|
||||||
loop delay threshold.
|
loop delay threshold.
|
||||||
|
|
||||||
#### histogram.max
|
#### histogram.max
|
||||||
|
<!-- YAML
|
||||||
|
added: REPLACEME
|
||||||
|
-->
|
||||||
|
|
||||||
* Value: {number}
|
* {number}
|
||||||
|
|
||||||
The maximum recorded event loop delay.
|
The maximum recorded event loop delay.
|
||||||
|
|
||||||
#### histogram.mean
|
#### histogram.mean
|
||||||
|
<!-- YAML
|
||||||
|
added: REPLACEME
|
||||||
|
-->
|
||||||
|
|
||||||
* Value: {number}
|
* {number}
|
||||||
|
|
||||||
The mean of the recorded event loop delays.
|
The mean of the recorded event loop delays.
|
||||||
|
|
||||||
@ -482,19 +491,26 @@ The mean of the recorded event loop delays.
|
|||||||
added: REPLACEME
|
added: REPLACEME
|
||||||
-->
|
-->
|
||||||
|
|
||||||
* Value: {number}
|
* {number}
|
||||||
|
|
||||||
The minimum recorded event loop delay.
|
The minimum recorded event loop delay.
|
||||||
|
|
||||||
#### histogram.percentile(percentile)
|
#### histogram.percentile(percentile)
|
||||||
|
<!-- YAML
|
||||||
|
added: REPLACEME
|
||||||
|
-->
|
||||||
|
|
||||||
* `percentile` {number} A percentile value between 1 and 100.
|
* `percentile` {number} A percentile value between 1 and 100.
|
||||||
|
* Returns: {number}
|
||||||
|
|
||||||
Returns the value at the given percentile.
|
Returns the value at the given percentile.
|
||||||
|
|
||||||
#### histogram.percentiles
|
#### histogram.percentiles
|
||||||
|
<!-- YAML
|
||||||
|
added: REPLACEME
|
||||||
|
-->
|
||||||
|
|
||||||
* Value: {Map}
|
* {Map}
|
||||||
|
|
||||||
Returns a `Map` object detailing the accumulated percentile distribution.
|
Returns a `Map` object detailing the accumulated percentile distribution.
|
||||||
|
|
||||||
@ -506,8 +522,11 @@ added: REPLACEME
|
|||||||
Resets the collected histogram data.
|
Resets the collected histogram data.
|
||||||
|
|
||||||
#### histogram.stddev
|
#### histogram.stddev
|
||||||
|
<!-- YAML
|
||||||
|
added: REPLACEME
|
||||||
|
-->
|
||||||
|
|
||||||
* Value: {number}
|
* {number}
|
||||||
|
|
||||||
The standard deviation of the recorded event loop delays.
|
The standard deviation of the recorded event loop delays.
|
||||||
|
|
||||||
|
@ -75,8 +75,6 @@ const customTypesMap = {
|
|||||||
'fs.Stats': 'fs.html#fs_class_fs_stats',
|
'fs.Stats': 'fs.html#fs_class_fs_stats',
|
||||||
'fs.WriteStream': 'fs.html#fs_class_fs_writestream',
|
'fs.WriteStream': 'fs.html#fs_class_fs_writestream',
|
||||||
|
|
||||||
'Histogram': 'perf_hooks.html#perf_hooks_class_histogram',
|
|
||||||
|
|
||||||
'http.Agent': 'http.html#http_class_http_agent',
|
'http.Agent': 'http.html#http_class_http_agent',
|
||||||
'http.ClientRequest': 'http.html#http_class_http_clientrequest',
|
'http.ClientRequest': 'http.html#http_class_http_clientrequest',
|
||||||
'http.IncomingMessage': 'http.html#http_class_http_incomingmessage',
|
'http.IncomingMessage': 'http.html#http_class_http_incomingmessage',
|
||||||
@ -107,6 +105,7 @@ const customTypesMap = {
|
|||||||
|
|
||||||
'os.constants.dlopen': 'os.html#os_dlopen_constants',
|
'os.constants.dlopen': 'os.html#os_dlopen_constants',
|
||||||
|
|
||||||
|
'Histogram': 'perf_hooks.html#perf_hooks_class_histogram',
|
||||||
'PerformanceEntry': 'perf_hooks.html#perf_hooks_class_performanceentry',
|
'PerformanceEntry': 'perf_hooks.html#perf_hooks_class_performanceentry',
|
||||||
'PerformanceNodeTiming':
|
'PerformanceNodeTiming':
|
||||||
'perf_hooks.html#perf_hooks_class_performancenodetiming_extends_performanceentry', // eslint-disable-line max-len
|
'perf_hooks.html#perf_hooks_class_performancenodetiming_extends_performanceentry', // eslint-disable-line max-len
|
||||||
|
Loading…
x
Reference in New Issue
Block a user