Skip to content

trace_events: adds a new trace_events api - #19803

Closed
jasnell wants to merge 3 commits into
nodejs:masterfrom
jasnell:trace-events-api
Closed

jasnell wants to merge 3 commits into
nodejs:masterfrom
jasnell:trace-events-api

Conversation

@jasnell

@jasnell jasnell commented Apr 4, 2018

Copy link
Copy Markdown
Member

Removes the requirement to use --trace-events-enabled to enable trace events. Tracing is enabled automatically if there are any enabled categories.

Adds a new trace_events module with an API for enabling/disabling trace events at runtime without a command line flag.

const trace_events = require('trace_events');
const categories = [ 'node.perf', 'node.async_hooks' ];
const tracing = trace_events.createTracing({ categories });
tracing.enable();
// do stuff
tracing.disable();

Multiple Tracing objects may exist and be enabled at any point in time. The enabled trace event categories is the union of all enabled Tracing objects and the --trace-event-categories flag.

Alternative to: #19233

ping @ofrobots @AndreasMadsen @mcollina @nodejs/diagnostics

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • documentation is changed or added
  • commit message follows commit guidelines

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

lib / src Issues and PRs involving general changes in the lib/ or src/ directories. semver-major PRs that contain breaking changes and should be released in the next major version. trace_events Issues and PRs related to trace events from V8, Node.js core, and user code.

Projects

None yet

Development

Successfully merging this pull request may close these issues.