From 9eeee0d9f2123c8aaafd3867b5e69ac70a107b4b Mon Sep 17 00:00:00 2001 From: Kirill Fomichev Date: Fri, 13 Sep 2019 17:25:31 +0300 Subject: [PATCH] perf_hooks: add property flags to GCPerformanceEntry PR-URL: https://github.com/nodejs/node/pull/29547 Reviewed-By: James M Snell Reviewed-By: Chengzhong Wu --- doc/api/perf_hooks.md | 19 +++++++++++++++++++ src/node_perf.cc | 20 ++++++++++++++++++++ src/node_perf.h | 24 +++++++++++++++++++++++- test/parallel/test-performance-gc.js | 4 +++- 4 files changed, 65 insertions(+), 2 deletions(-) diff --git a/doc/api/perf_hooks.md b/doc/api/perf_hooks.md index a34d41ce3f250f..ebfddc3cee5407 100644 --- a/doc/api/perf_hooks.md +++ b/doc/api/perf_hooks.md @@ -209,6 +209,25 @@ The value may be one of: * `perf_hooks.constants.NODE_PERFORMANCE_GC_INCREMENTAL` * `perf_hooks.constants.NODE_PERFORMANCE_GC_WEAKCB` +### performanceEntry.flags + + +* {number} + +When `performanceEntry.entryType` is equal to `'gc'`, the `performance.flags` +property contains additional information about garbage collection operation. +The value may be one of: + +* `perf_hooks.constants.NODE_PERFORMANCE_GC_FLAGS_NO` +* `perf_hooks.constants.NODE_PERFORMANCE_GC_FLAGS_CONSTRUCT_RETAINED` +* `perf_hooks.constants.NODE_PERFORMANCE_GC_FLAGS_FORCED` +* `perf_hooks.constants.NODE_PERFORMANCE_GC_FLAGS_SYNCHRONOUS_PHANTOM_PROCESSING` +* `perf_hooks.constants.NODE_PERFORMANCE_GC_FLAGS_ALL_AVAILABLE_GARBAGE` +* `perf_hooks.constants.NODE_PERFORMANCE_GC_FLAGS_ALL_EXTERNAL_MEMORY` +* `perf_hooks.constants.NODE_PERFORMANCE_GC_FLAGS_SCHEDULE_IDLE` + ## Class: `PerformanceNodeTiming extends PerformanceEntry`