From 645be73b9d0196ba704e22e1375584a7fc797287 Mon Sep 17 00:00:00 2001 From: James M Snell Date: Mon, 8 Jan 2018 13:32:30 -0800 Subject: [PATCH] perf_hooks,http2: add performance.clear() Add missing clear() method to `perf_hooks.performance` to remove the entries from the master timeline to prevent that from being a memory leak. PR-URL: https://github.com/nodejs/node/pull/18046 Reviewed-By: Matteo Collina --- doc/api/perf_hooks.md | 8 ++++++++ lib/perf_hooks.js | 4 ++++ test/parallel/test-http2-perf_hooks.js | 10 +++++++++- 3 files changed, 21 insertions(+), 1 deletion(-) diff --git a/doc/api/perf_hooks.md b/doc/api/perf_hooks.md index 5ce94624cb9d22..3f2cc506f3148a 100644 --- a/doc/api/perf_hooks.md +++ b/doc/api/perf_hooks.md @@ -29,6 +29,14 @@ added: v8.5.0 The `Performance` provides access to performance metric data. A single instance of this class is provided via the `performance` property. +### performance.clearEntries(name) + + +Remove all performance entry objects with `entryType` equal to `name` from the +Performance Timeline. + ### performance.clearFunctions([name])