CDPotion.Domain.Tracing (cdpotion v0.1.4)

Summary

Types

Configuration for memory dump. Used only when 'memory-infra' category is enabled.

Details exposed when memory request explicitly declared. Keep consistent with memory_dump_request_args.h and memory_instrumentation.mojom

Compression type to use for traces returned via streams.

Data format of a trace. Can be either the legacy JSON format or the protocol buffer format. Note that the JSON format will be deprecated soon.

description not provided :(

Backend type to use for tracing. chrome uses the Chrome-integrated tracing service and is supported on all platforms. system is only supported on Chrome OS and uses the Perfetto system tracing service. auto chooses system when the perfettoConfig provided to Tracing.start specifies at least one non-Chrome data source; otherwise uses chrome.

Types

Link to this type

memory_dump_config()

@type memory_dump_config() :: map()

Configuration for memory dump. Used only when 'memory-infra' category is enabled.

Link to this type

memory_dump_level_of_detail()

@type memory_dump_level_of_detail() :: :background | :light | :detailed

Details exposed when memory request explicitly declared. Keep consistent with memory_dump_request_args.h and memory_instrumentation.mojom

Link to this type

stream_compression()

@type stream_compression() :: :none | :gzip

Compression type to use for traces returned via streams.

Link to this type

stream_format()

@type stream_format() :: :json | :proto

Data format of a trace. Can be either the legacy JSON format or the protocol buffer format. Note that the JSON format will be deprecated soon.

Link to this type

trace_config()

@type trace_config() :: %{
  enableArgumentFilter: boolean() | nil,
  enableSampling: boolean() | nil,
  enableSystrace: boolean() | nil,
  excludedCategories: [String.t()] | nil,
  includedCategories: [String.t()] | nil,
  memoryDumpConfig: memory_dump_config() | nil,
  recordMode:
    :recordUntilFull
    | :recordContinuously
    | :recordAsMuchAsPossible
    | :echoToConsole
    | nil,
  syntheticDelays: [String.t()] | nil,
  traceBufferSizeInKb: number() | nil
}

description not provided :(

Link to this type

tracing_backend()

@type tracing_backend() :: :auto | :chrome | :system

Backend type to use for tracing. chrome uses the Chrome-integrated tracing service and is supported on all platforms. system is only supported on Chrome OS and uses the Perfetto system tracing service. auto chooses system when the perfettoConfig provided to Tracing.start specifies at least one non-Chrome data source; otherwise uses chrome.

Functions

@spec end!() :: {String.t(), map()}

Stop trace events collection.

Link to this function

get_categories()

@spec get_categories() :: {String.t(), map()}

Gets supported tracing categories.

Link to this function

record_clock_sync_marker(sync_id)

@spec record_clock_sync_marker(String.t()) :: {String.t(), map()}

Record a clock sync marker in the trace.

Parameters:

  • (Required) sync_id: The ID of this clock sync marker
Link to this function

request_memory_dump(deterministic \\ nil, level_of_detail \\ nil)

@spec request_memory_dump(boolean(), memory_dump_level_of_detail()) ::
  {String.t(), map()}

Request a global memory dump.

Parameters:

  • (Optional) deterministic: Enables more deterministic results by forcing garbage collection
  • (Optional) level_of_detail: Specifies level of details in memory dump. Defaults to "detailed".
Link to this function

start(categories \\ nil, options \\ nil, buffer_usage_reporting_interval \\ nil, transfer_mode \\ nil, stream_format \\ nil, stream_compression \\ nil, trace_config \\ nil, perfetto_config \\ nil, tracing_backend \\ nil)

Start trace events collection.

Parameters:

  • (Optional) categories: Category/tag filter
  • (Optional) options: Tracing options
  • (Optional) buffer_usage_reporting_interval: If set, the agent will issue bufferUsage events at this interval, specified in milliseconds
  • (Optional) transfer_mode: Whether to report trace events as series of dataCollected events or to save trace to a stream (defaults to ReportEvents).
  • (Optional) stream_format: Trace data format to use. This only applies when using ReturnAsStream transfer mode (defaults to json).
  • (Optional) stream_compression: Compression format to use. This only applies when using ReturnAsStream transfer mode (defaults to none)
  • (Optional) trace_config: description not provided :(
  • (Optional) perfetto_config: Base64-encoded serialized perfetto.protos.TraceConfig protobuf message When specified, the parameters categories, options, traceConfig are ignored. (Encoded as a base64 string when passed over JSON)
  • (Optional) tracing_backend: Backend type (defaults to auto)