Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nodejs/node.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnna Henningsen <anna@addaleax.net>2020-09-11 17:24:06 +0300
committerRich Trott <rtrott@gmail.com>2020-09-14 22:58:47 +0300
commit6eb15ce8a3bebeda605b88972ae007bafb3a1133 (patch)
treef13fc71ae580f73f4a6313e680029519eb8950dd /doc/api/perf_hooks.md
parent571dff81d5481efc30a6b8fd495611b5c2674037 (diff)
doc: update eventLoopUtilization documentation
PR-URL: https://github.com/nodejs/node/pull/35155 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
Diffstat (limited to 'doc/api/perf_hooks.md')
-rw-r--r--doc/api/perf_hooks.md32
1 files changed, 16 insertions, 16 deletions
diff --git a/doc/api/perf_hooks.md b/doc/api/perf_hooks.md
index e08f81a69c9..f260e28c234 100644
--- a/doc/api/perf_hooks.md
+++ b/doc/api/perf_hooks.md
@@ -53,13 +53,13 @@ added: v8.5.0
If `name` is not provided, removes all `PerformanceMark` objects from the
Performance Timeline. If `name` is provided, removes only the named mark.
-### `performance.eventLoopUtilization([util1][,util2])`
+### `performance.eventLoopUtilization([utilization1[, utilization2]])`
<!-- YAML
added: v14.10.0
-->
-* `util1` {Object} The result of a previous call to `eventLoopUtilization()`
-* `util2` {Object} The result of a previous call to `eventLoopUtilization()`
+* `utilization1` {Object} The result of a previous call to `eventLoopUtilization()`
+* `utilization2` {Object} The result of a previous call to `eventLoopUtilization()`
prior to `util1`
* Returns {Object}
* `idle` {number}
@@ -72,23 +72,23 @@ high resolution milliseconds timer. The `utilization` value is the calculated
Event Loop Utilization (ELU). If bootstrapping has not yet finished, the
properties have the value of 0.
-`util1` and `util2` are optional parameters.
+`utilization1` and `utilization2` are optional parameters.
-If `util1` is passed then the delta between the current call's `active` and
-`idle` times are calculated and returned (similar to [`process.hrtime()`][]).
-Likewise the adjusted `utilization` value is calculated.
+If `utilization1` is passed, then the delta between the current call's `active`
+and `idle` times, as well as the corresponding `utilization` value are
+calculated and returned (similar to [`process.hrtime()`][]).
-If `util1` and `util2` are both passed then the calculation adjustments are
-done between the two arguments. This is a convenience option because unlike
-[`process.hrtime()`][] additional work is done to calculate the ELU.
+If `utilization1` and `utilization2` are both passed, then the delta is
+calculated between the two arguments. This is a convenience option because,
+unlike [`process.hrtime()`][], calculating the ELU is more complex than a
+single subtraction.
-ELU is similar to CPU utilization except that it is calculated using high
-precision wall-clock time. It represents the percentage of time the event loop
-has spent outside the event loop's event provider (e.g. `epoll_wait`). No other
-CPU idle time is taken into consideration. The following is an example of how
-a mostly idle process will have a high ELU.
+ELU is similar to CPU utilization, except that it only measures event loop
+statistics and not CPU usage. It represents the percentage of time the event
+loop has spent outside the event loop's event provider (e.g. `epoll_wait`).
+No other CPU idle time is taken into consideration. The following is an example
+of how a mostly idle process will have a high ELU.
-<!-- eslint-skip -->
```js
'use strict';
const { eventLoopUtilization } = require('perf_hooks').performance;