From 6eb15ce8a3bebeda605b88972ae007bafb3a1133 Mon Sep 17 00:00:00 2001 From: Anna Henningsen Date: Fri, 11 Sep 2020 16:24:06 +0200 Subject: [PATCH] doc: update eventLoopUtilization documentation PR-URL: https://github.com/nodejs/node/pull/35155 Reviewed-By: James M Snell Reviewed-By: Rich Trott --- doc/api/perf_hooks.md | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/doc/api/perf_hooks.md b/doc/api/perf_hooks.md index e08f81a69c916b..f260e28c234d25 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]])` -* `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. - ```js 'use strict'; const { eventLoopUtilization } = require('perf_hooks').performance;