contentTracing

    Process: Main

    This module does not include a web interface. To view recorded traces, use , available at chrome://tracing in Chrome.

    Note: You should not use this module until the ready event of the app module is emitted.

    The contentTracing module has the following methods:

    Returns Promise<String[]> - resolves with an array of category groups once all child processes have acknowledged the request

    NOTE: Electron adds a non-default tracing category called "electron". This category can be used to capture Electron-specific tracing events.

    Returns Promise<void> - resolved once all child processes have acknowledged the startRecording request.

    Start recording on all processes.

    Recording begins immediately locally and asynchronously on child processes as soon as they receive the EnableRecording request.

    If a recording is already running, the promise will be immediately resolved, as only one trace operation can be in progress at a time.

    • resultFilePath String (optional)

    Stop recording on all processes.

    Child processes typically cache trace data and only rarely flush and send trace data back to the main process. This helps to minimize the runtime overhead of tracing since sending trace data over IPC can be an expensive operation. So, to end tracing, Chromium asynchronously asks all child processes to flush any pending trace data.

    Trace data will be written into resultFilePath. If resultFilePath is empty or not provided, trace data will be written to a temporary file, and the path will be returned in the promise.

    Returns Promise<Object> - Resolves with an object containing the value and percentage of trace buffer maximum usage

    • value Number

    Get the maximum usage across processes of trace buffer as a percentage of the full state.