Lines Matching +full:node +full:- +full:api
3 <!--introduced_in=v7.7.0-->
5 > Stability: 1 - Experimental
7 <!-- source_link=lib/trace_events.js -->
10 generated by V8, Node.js core, and userspace code.
12 Tracing can be enabled with the `--trace-event-categories` command-line flag
13 or by using the `trace_events` module. The `--trace-event-categories` flag
14 accepts a list of comma-separated category names.
18 * `node`: An empty placeholder.
19 * `node.async_hooks`: Enables capture of detailed [`async_hooks`][] trace data.
22 * `node.bootstrap`: Enables capture of Node.js bootstrap milestones.
23 * `node.console`: Enables capture of `console.time()` and `console.count()`
25 * `node.dns.native`: Enables capture of trace data for DNS queries.
26 * `node.environment`: Enables capture of Node.js Environment milestones.
27 * `node.fs.sync`: Enables capture of trace data for file system sync methods.
28 * `node.perf`: Enables capture of [Performance API][] measurements.
29 * `node.perf.usertiming`: Enables capture of only Performance API User Timing
31 * `node.perf.timerify`: Enables capture of only Performance API timerify
33 * `node.promises.rejections`: Enables capture of trace data tracking the number
34 of unhandled Promise rejections and handled-after-rejections.
35 * `node.vm.script`: Enables capture of trace data for the `vm` module's
39 By default the `node`, `node.async_hooks`, and `v8` categories are enabled.
42 node --trace-event-categories v8,node,node.async_hooks server.js
45 Prior versions of Node.js required the use of the `--trace-events-enabled`
47 `--trace-events-enabled` flag *may* still be used and will enable the
48 `node`, `node.async_hooks`, and `v8` trace event categories by default.
51 node --trace-events-enabled
55 node --trace-event-categories v8,node,node.async_hooks
62 const tracing = trace_events.createTracing({ categories: ['node.perf'] });
63 tracing.enable(); // Enable trace event capture for the 'node.perf' category
67 tracing.disable(); // Disable trace event capture for the 'node.perf' category
70 Running Node.js with tracing enabled will produce log files that can be opened
71 in the [`chrome://tracing`](https://www.chromium.org/developers/how-tos/trace-event-profiling-tool)
75 `${rotation}` is an incrementing log-rotation id. The filepath pattern can
76 be specified with `--trace-event-file-pattern` that accepts a template
80 node --trace-event-categories v8 --trace-event-file-pattern '${pid}-${rotation}.log' server.js
85 However the trace-event timestamps are expressed in microseconds,
91 <!-- YAML
93 -->
96 <!-- YAML
98 -->
110 <!-- YAML
112 -->
116 A comma-separated list of the trace event categories covered by this
120 <!-- YAML
122 -->
127 and *not* specified by the `--trace-event-categories` flag will be disabled.
131 const t1 = trace_events.createTracing({ categories: ['node', 'v8'] });
132 const t2 = trace_events.createTracing({ categories: ['node.perf', 'node'] });
136 // Prints 'node,node.perf,v8'
139 t2.disable(); // Will only disable emission of the 'node.perf' category
141 // Prints 'node,v8'
146 <!-- YAML
148 -->
154 <!-- YAML
156 -->
161 <!-- YAML
163 -->
175 const categories = ['node.perf', 'node.async_hooks'];
183 <!-- YAML
185 -->
189 Returns a comma-separated list of all currently-enabled trace event
191 by the *union* of all currently-enabled `Tracing` objects and any categories
192 enabled using the `--trace-event-categories` flag.
195 `node --trace-event-categories node.perf test.js` will print
196 `'node.async_hooks,node.perf'` to the console.
200 const t1 = trace_events.createTracing({ categories: ['node.async_hooks'] });
201 const t2 = trace_events.createTracing({ categories: ['node.perf'] });
210 [Performance API]: perf_hooks.html