TraceConfig 对象

  • recording_mode String (optional) - Can be record-until-full, record-continuously, record-as-much-as-possible or trace-to-console. Defaults to record-until-full.
  • trace_buffer_size_in_kb number (optional) - maximum size of the trace recording buffer in kilobytes. Defaults to 100MB.
  • trace_buffer_size_in_events number (optional) - maximum size of the trace recording buffer in events.
  • enable_argument_filter boolean (optional) - if true, filter event data according to a whitelist of events that have been manually vetted to not include any PII. See the implementation in Chromium for specifics.
  • included_categories String[] (optional) - a list of tracing categories to include. Can include glob-like patterns using * at the end of the category name. See tracing categories for the list of categories.
  • excluded_categories String[] (optional) - a list of tracing categories to exclude. Can include glob-like patterns using * at the end of the category name. See tracing categories for the list of categories.
  • included_process_ids number[] (optional) - a list of process IDs to include in the trace. If not specified, trace all processes.
  • histogram_names String[] (optional) - a list of histogram names to report with the trace.
  • memory_dump_config Record (optional) - if the disabled-by-default-memory-infra category is enabled, this contains optional additional configuration for data collection. See the Chromium memory-infra docs for more information.

An example TraceConfig that roughly matches what Chrome DevTools records:

  1. {
  2. recording_mode: 'record-until-full',
  3. included_categories: [
  4. 'devtools.timeline',
  5. 'disabled-by-default-devtools.timeline',
  6. 'disabled-by-default-devtools.timeline.frame',
  7. 'disabled-by-default-devtools.timeline.stack',
  8. 'v8.execute',
  9. 'blink.console',
  10. 'blink.user_timing',
  11. 'latencyInfo',
  12. 'disabled-by-default-v8.cpu_profiler',
  13. 'disabled-by-default-v8.cpu_profiler.hires'
  14. ],
  15. excluded_categories: [ '*' ]
  16. }