← Back to release summary

droppedEntriesCount in PerformanceObserver callback

Category
Performance
Type
Chromium catches up
Status
Enabled by default (Chrome 95)
Intent stage
Shipped

Summary

Currently, web developers can use PerformanceObserver with buffered flag to listen to past and future performance entries about their site. However, past entries need to be stored, and there is a buffer size limit. The droppedEntriesCount parameter helps developers know if they may have lost an entry due to this storage being full. It's set to the number of entries which got dropped from the buffer due to such buffer being full.

Motivation

Currently, we recommend using PerformanceObserver, which receives performance entries via a callback that is provided in the constructor of the observer. The observer signals which entries it's interested in via the observe() method. When called with the buffered flag, this results in buffered entries being dispatched to the observer on the first observer callback. The entries are buffered in entryType-specific buffers, and they are useful to allow developers to load performance scripts lazily, instead of early during the page load to avoid losing data. The droppedEntriesCount parameter helps developers know if they may have lost an entry due to the buffer being full.

Standards & signals

Explainers: https://github.com/npm1/hasDroppedEntry/blob/master/README.md

View on chromestatus.com