Skip to content

Commit

Permalink
doc: add PerformanceObserver buffered document
Browse files Browse the repository at this point in the history
The option buffered is not about queueing the PerformanceEntrys with
an event loop task or not. The option buffered in the spec is about
filling the observer with the global PerformanceEntry buffer. The
current (and the spec) behavior is different with Node.js
version <= v16.0.0.

PR-URL: #39514
Refs: https://w3c.github.io/performance-timeline/#observe-method
Refs: https://nodejs.org/dist/latest-v14.x/docs/api/perf_hooks.html#perf_hooks_performanceobserver_observe_options
Refs: #39297
Reviewed-By: Antoine du Hamel <[email protected]>
Reviewed-By: Benjamin Gruenbaum <[email protected]>
  • Loading branch information
legendecas authored and targos committed Aug 2, 2021
1 parent 7b612fa commit 869ced9
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions doc/api/perf_hooks.md
Original file line number Diff line number Diff line change
Expand Up @@ -585,6 +585,10 @@ Disconnects the `PerformanceObserver` instance from all notifications.
<!-- YAML
added: v8.5.0
changes:
- version: REPLACEME
pr-url: https://github.com/nodejs/node/pull/39297
description: Updated to conform to Performance Timeline Level 2. The
buffered option has been added back.
- version: v16.0.0
pr-url: https://github.com/nodejs/node/pull/37136
description: Updated to conform to User Timing Level 3. The
Expand All @@ -597,6 +601,10 @@ changes:
* `entryTypes` {string[]} An array of strings identifying the types of
{PerformanceEntry} instances the observer is interested in. If not
provided an error will be thrown.
* `buffered` {boolean} If true, the observer callback is called with a
list global `PerformanceEntry` buffered entries. If false, only
`PerformanceEntry`s created after the time point are sent to the
observer callback. **Default:** `false`.

Subscribes the {PerformanceObserver} instance to notifications of new
{PerformanceEntry} instances identified either by `options.entryTypes`
Expand Down

0 comments on commit 869ced9

Please sign in to comment.