From 9e509b622bbdc14b7153d006f57043f268017138 Mon Sep 17 00:00:00 2001 From: James M Snell Date: Wed, 14 Feb 2018 11:06:32 -0800 Subject: perf_hooks: emit trace events for marks, measures, and timerify Adds the `node.perf.usertiming` trace events category for recording usertiming marks and measures (e.g. `perf_hooks.performance.mark()`) in the trace events timeline. Adds the `node.perf.function` trace events category for recording `perf_hooks.performance.timerify()` durations in the trace events timeline. PR-URL: https://github.com/nodejs/node/pull/18789 Reviewed-By: Ali Ijaz Sheikh Reviewed-By: Matteo Collina --- doc/api/perf_hooks.md | 4 +- doc/api/tracing.md | 18 +++++++- src/node_perf.cc | 20 ++++++-- src/node_perf.h | 1 + src/tracing/trace_event.h | 17 +++++-- test/parallel/test-trace-events-perf.js | 82 +++++++++++++++++++++++++++++++++ 6 files changed, 131 insertions(+), 11 deletions(-) create mode 100644 test/parallel/test-trace-events-perf.js diff --git a/doc/api/perf_hooks.md b/doc/api/perf_hooks.md index 5bef91eafb..4e31a24785 100644 --- a/doc/api/perf_hooks.md +++ b/doc/api/perf_hooks.md @@ -268,8 +268,8 @@ added: v8.5.0 * {string} -The type of the performance entry. Current it may be one of: `'node'`, `'mark'`, -`'measure'`, `'gc'`, or `'function'`. +The type of the performance entry. Currently it may be one of: `'node'`, +`'mark'`, `'measure'`, `'gc'`, or `'function'`. ### performanceEntry.kind