Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit aea3f77

Browse filesBrowse files
addaleaxruyadorno
authored andcommitted
doc: update eventLoopUtilization documentation
PR-URL: #35155 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
1 parent 32d1731 commit aea3f77
Copy full SHA for aea3f77

File tree

Expand file treeCollapse file tree

1 file changed

+16
-16
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+16
-16
lines changed
Open diff view settings
Collapse file

‎doc/api/perf_hooks.md‎

Copy file name to clipboardExpand all lines: doc/api/perf_hooks.md
+16-16Lines changed: 16 additions & 16 deletions
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -53,13 +53,13 @@ added: v8.5.0
5353
If `name` is not provided, removes all `PerformanceMark` objects from the
5454
Performance Timeline. If `name` is provided, removes only the named mark.
5555

56-
### `performance.eventLoopUtilization([util1][,util2])`
56+
### `performance.eventLoopUtilization([utilization1[, utilization2]])`
5757
<!-- YAML
5858
added: v14.10.0
5959
-->
6060

61-
* `util1` {Object} The result of a previous call to `eventLoopUtilization()`
62-
* `util2` {Object} The result of a previous call to `eventLoopUtilization()`
61+
* `utilization1` {Object} The result of a previous call to `eventLoopUtilization()`
62+
* `utilization2` {Object} The result of a previous call to `eventLoopUtilization()`
6363
prior to `util1`
6464
* Returns {Object}
6565
* `idle` {number}
@@ -72,23 +72,23 @@ high resolution milliseconds timer. The `utilization` value is the calculated
7272
Event Loop Utilization (ELU). If bootstrapping has not yet finished, the
7373
properties have the value of 0.
7474

75-
`util1` and `util2` are optional parameters.
75+
`utilization1` and `utilization2` are optional parameters.
7676

77-
If `util1` is passed then the delta between the current call's `active` and
78-
`idle` times are calculated and returned (similar to [`process.hrtime()`][]).
79-
Likewise the adjusted `utilization` value is calculated.
77+
If `utilization1` is passed, then the delta between the current call's `active`
78+
and `idle` times, as well as the corresponding `utilization` value are
79+
calculated and returned (similar to [`process.hrtime()`][]).
8080

81-
If `util1` and `util2` are both passed then the calculation adjustments are
82-
done between the two arguments. This is a convenience option because unlike
83-
[`process.hrtime()`][] additional work is done to calculate the ELU.
81+
If `utilization1` and `utilization2` are both passed, then the delta is
82+
calculated between the two arguments. This is a convenience option because,
83+
unlike [`process.hrtime()`][], calculating the ELU is more complex than a
84+
single subtraction.
8485

85-
ELU is similar to CPU utilization except that it is calculated using high
86-
precision wall-clock time. It represents the percentage of time the event loop
87-
has spent outside the event loop's event provider (e.g. `epoll_wait`). No other
88-
CPU idle time is taken into consideration. The following is an example of how
89-
a mostly idle process will have a high ELU.
86+
ELU is similar to CPU utilization, except that it only measures event loop
87+
statistics and not CPU usage. It represents the percentage of time the event
88+
loop has spent outside the event loop's event provider (e.g. `epoll_wait`).
89+
No other CPU idle time is taken into consideration. The following is an example
90+
of how a mostly idle process will have a high ELU.
9091

91-
<!-- eslint-skip -->
9292
```js
9393
'use strict';
9494
const { eventLoopUtilization } = require('perf_hooks').performance;

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.