Skip to content

Commit 869ced9

Browse files
legendecastargos
authored andcommitted
doc: add PerformanceObserver buffered document
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 <duhamelantoine1995@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
1 parent 7b612fa commit 869ced9

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

doc/api/perf_hooks.md

+8
Original file line numberDiff line numberDiff line change
@@ -585,6 +585,10 @@ Disconnects the `PerformanceObserver` instance from all notifications.
585585
<!-- YAML
586586
added: v8.5.0
587587
changes:
588+
- version: REPLACEME
589+
pr-url: https://github.com/nodejs/node/pull/39297
590+
description: Updated to conform to Performance Timeline Level 2. The
591+
buffered option has been added back.
588592
- version: v16.0.0
589593
pr-url: https://github.com/nodejs/node/pull/37136
590594
description: Updated to conform to User Timing Level 3. The
@@ -597,6 +601,10 @@ changes:
597601
* `entryTypes` {string[]} An array of strings identifying the types of
598602
{PerformanceEntry} instances the observer is interested in. If not
599603
provided an error will be thrown.
604+
* `buffered` {boolean} If true, the observer callback is called with a
605+
list global `PerformanceEntry` buffered entries. If false, only
606+
`PerformanceEntry`s created after the time point are sent to the
607+
observer callback. **Default:** `false`.
600608

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

0 commit comments

Comments
 (0)