Skip to content

Commit 663b625

Browse files
vsemozhetbytaddaleax
authored andcommitted
doc: fix some nits in perf_hooks
PR-URL: #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>
1 parent ae21fca commit 663b625

File tree

2 files changed

+29
-11
lines changed

2 files changed

+29
-11
lines changed

doc/api/perf_hooks.md

+28-9
Original file line numberDiff line numberDiff line change
@@ -398,14 +398,14 @@ Returns a list of `PerformanceEntry` objects in chronological order
398398
with respect to `performanceEntry.startTime` whose `performanceEntry.entryType`
399399
is equal to `type`.
400400

401-
## monitorEventLoopDelay([options])
401+
## perf_hooks.monitorEventLoopDelay([options])
402402
<!-- YAML
403403
added: REPLACEME
404404
-->
405405

406406
* `options` {Object}
407407
* `resolution` {number} The sampling rate in milliseconds. Must be greater
408-
than zero. Defaults to `10`.
408+
than zero. **Default:** `10`.
409409
* Returns: {Histogram}
410410

411411
Creates a `Histogram` object that samples and reports the event loop delay
@@ -421,7 +421,7 @@ detect.
421421
const { monitorEventLoopDelay } = require('perf_hooks');
422422
const h = monitorEventLoopDelay({ resolution: 20 });
423423
h.enable();
424-
// Do something
424+
// Do something.
425425
h.disable();
426426
console.log(h.min);
427427
console.log(h.max);
@@ -459,21 +459,30 @@ Enables the event loop delay sample timer. Returns `true` if the timer was
459459
started, `false` if it was already started.
460460

461461
#### histogram.exceeds
462+
<!-- YAML
463+
added: REPLACEME
464+
-->
462465

463-
* Value: {number}
466+
* {number}
464467

465468
The number of times the event loop delay exceeded the maximum 1 hour event
466469
loop delay threshold.
467470

468471
#### histogram.max
472+
<!-- YAML
473+
added: REPLACEME
474+
-->
469475

470-
* Value: {number}
476+
* {number}
471477

472478
The maximum recorded event loop delay.
473479

474480
#### histogram.mean
481+
<!-- YAML
482+
added: REPLACEME
483+
-->
475484

476-
* Value: {number}
485+
* {number}
477486

478487
The mean of the recorded event loop delays.
479488

@@ -482,19 +491,26 @@ The mean of the recorded event loop delays.
482491
added: REPLACEME
483492
-->
484493

485-
* Value: {number}
494+
* {number}
486495

487496
The minimum recorded event loop delay.
488497

489498
#### histogram.percentile(percentile)
499+
<!-- YAML
500+
added: REPLACEME
501+
-->
490502

491503
* `percentile` {number} A percentile value between 1 and 100.
504+
* Returns: {number}
492505

493506
Returns the value at the given percentile.
494507

495508
#### histogram.percentiles
509+
<!-- YAML
510+
added: REPLACEME
511+
-->
496512

497-
* Value: {Map}
513+
* {Map}
498514

499515
Returns a `Map` object detailing the accumulated percentile distribution.
500516

@@ -506,8 +522,11 @@ added: REPLACEME
506522
Resets the collected histogram data.
507523

508524
#### histogram.stddev
525+
<!-- YAML
526+
added: REPLACEME
527+
-->
509528

510-
* Value: {number}
529+
* {number}
511530

512531
The standard deviation of the recorded event loop delays.
513532

tools/doc/type-parser.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,6 @@ const customTypesMap = {
7575
'fs.Stats': 'fs.html#fs_class_fs_stats',
7676
'fs.WriteStream': 'fs.html#fs_class_fs_writestream',
7777

78-
'Histogram': 'perf_hooks.html#perf_hooks_class_histogram',
79-
8078
'http.Agent': 'http.html#http_class_http_agent',
8179
'http.ClientRequest': 'http.html#http_class_http_clientrequest',
8280
'http.IncomingMessage': 'http.html#http_class_http_incomingmessage',
@@ -107,6 +105,7 @@ const customTypesMap = {
107105

108106
'os.constants.dlopen': 'os.html#os_dlopen_constants',
109107

108+
'Histogram': 'perf_hooks.html#perf_hooks_class_histogram',
110109
'PerformanceEntry': 'perf_hooks.html#perf_hooks_class_performanceentry',
111110
'PerformanceNodeTiming':
112111
'perf_hooks.html#perf_hooks_class_performancenodetiming_extends_performanceentry', // eslint-disable-line max-len

0 commit comments

Comments
 (0)