From 0a47b98f041a9a570f2cd29bb002e20f68d17797 Mon Sep 17 00:00:00 2001 From: James M Snell Date: Wed, 10 Jan 2018 09:42:10 -0800 Subject: [PATCH] perf_hooks: add warning when too many entries in the timeline PR-URL: https://github.com/nodejs/node/pull/18087 Reviewed-By: Matteo Collina --- doc/api/perf_hooks.md | 14 +++++++ lib/perf_hooks.js | 49 +++++++++++++++++++++-- test/parallel/test-performance-warning.js | 29 ++++++++++++++ 3 files changed, 88 insertions(+), 4 deletions(-) create mode 100644 test/parallel/test-performance-warning.js diff --git a/doc/api/perf_hooks.md b/doc/api/perf_hooks.md index 6d98d25af37cbc..608bee8d574680 100644 --- a/doc/api/perf_hooks.md +++ b/doc/api/perf_hooks.md @@ -125,6 +125,20 @@ Creates a new `PerformanceMark` entry in the Performance Timeline. A `performanceEntry.duration` is always `0`. Performance marks are used to mark specific significant moments in the Performance Timeline. +### performance.maxEntries + + +Value: {number} + +The maximum number of Performance Entry items that should be added to the +Performance Timeline. This limit is not strictly enforced, but a process +warning will be emitted if the number of entries in the timeline exceeds +this limit. + +Defaults to 150. + ### performance.measure(name, startMark, endMark)