• options {Object}
      • categories {string[]} An array of trace category names. Values included in the array are coerced to a string when possible. An error will be thrown if the value cannot be coerced.
    • Returns: {Tracing}.

    Creates and returns a Tracing object for the given set of categories.

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