w3c / performance-timeline

Performance Timeline
https://w3c.github.io/performance-timeline/
Other
111 stars 27 forks source link

Add support for flushing observer via `takeRecords()` #74

Closed igrigorik closed 6 years ago

igrigorik commented 7 years ago

Related discussion in https://github.com/w3c/performance-timeline/issues/66.

Use case: as a developer I want to flush and beacon all pending records when page visibility changes (e.g. transitions to 'hidden') or is about to be unloaded. Today, this is not possible.

To stay consistent with other <*>Observer patterns, we should support takeRecords():