From 3789d668f75c0a60c85208750a823e5c70184cb3 Mon Sep 17 00:00:00 2001 From: legendecas Date: Thu, 17 Feb 2022 00:24:37 +0800 Subject: [PATCH] doc: add missing api entries on performance PR-URL: https://github.com/nodejs/node/pull/42018 Reviewed-By: Benjamin Gruenbaum Reviewed-By: James M Snell Reviewed-By: Mohammed Keyvanzadeh --- doc/api/perf_hooks.md | 81 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 81 insertions(+) diff --git a/doc/api/perf_hooks.md b/doc/api/perf_hooks.md index fd7c2bbcd68729..18c8ddba02f9e2 100644 --- a/doc/api/perf_hooks.md +++ b/doc/api/perf_hooks.md @@ -55,6 +55,17 @@ 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.clearMeasures([name])` + + + +* `name` {string} + +If `name` is not provided, removes all `PerformanceMeasure` objects from the +Performance Timeline. If `name` is provided, removes only the named mark. + ### `performance.eventLoopUtilization([utilization1[, utilization2]])` + +* Returns: {PerformanceEntry\[]} + +Returns a list of `PerformanceEntry` objects in chronological order with +respect to `performanceEntry.startTime`. If you are only interested in +performance entries of certain types or that have certain names, see +`performance.getEntriesByType()` and `performance.getEntriesByName()`. + +### `performance.getEntriesByName(name[, type])` + + + +* `name` {string} +* `type` {string} +* Returns: {PerformanceEntry\[]} + +Returns a list of `PerformanceEntry` objects in chronological order +with respect to `performanceEntry.startTime` whose `performanceEntry.name` is +equal to `name`, and optionally, whose `performanceEntry.entryType` is equal to +`type`. + +### `performance.getEntriesByType(type)` + + + +* `type` {string} +* Returns: {PerformanceEntry\[]} + +Returns a list of `PerformanceEntry` objects in chronological order +with respect to `performanceEntry.startTime` whose `performanceEntry.entryType` +is equal to `type`. + ### `performance.mark([name[, options]])`