mirror of
https://github.com/nodejs/node.git
synced 2025-08-15 13:48:44 +02:00
perf_hooks: add resourcetiming buffer limit
Add WebPerf API `performance.setResourceTimingBufferSize` and event `'resourcetimingbufferfull'` support. The resource timing entries are added to the global performance timeline buffer automatically when using fetch. If users are not proactively cleaning these events, it can grow without limit. Apply the https://www.w3.org/TR/timing-entrytypes-registry/ default resource timing buffer max size so that the buffer can be limited to not grow indefinitely. PR-URL: https://github.com/nodejs/node/pull/44220 Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
This commit is contained in:
parent
0d46cf6af8
commit
798a6edddf
10 changed files with 339 additions and 11 deletions
|
@ -18,7 +18,10 @@ const {
|
|||
PerformanceMark,
|
||||
PerformanceMeasure,
|
||||
} = require('internal/perf/usertiming');
|
||||
const { InternalPerformance } = require('internal/perf/performance');
|
||||
const {
|
||||
Performance,
|
||||
performance,
|
||||
} = require('internal/perf/performance');
|
||||
|
||||
const {
|
||||
createHistogram
|
||||
|
@ -27,6 +30,7 @@ const {
|
|||
const monitorEventLoopDelay = require('internal/perf/event_loop_delay');
|
||||
|
||||
module.exports = {
|
||||
Performance,
|
||||
PerformanceEntry,
|
||||
PerformanceMark,
|
||||
PerformanceMeasure,
|
||||
|
@ -35,7 +39,7 @@ module.exports = {
|
|||
PerformanceResourceTiming,
|
||||
monitorEventLoopDelay,
|
||||
createHistogram,
|
||||
performance: new InternalPerformance(),
|
||||
performance,
|
||||
};
|
||||
|
||||
ObjectDefineProperty(module.exports, 'constants', {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue