Table of Contents

Interface ITracing

Namespace
Selenium.WebDriver.BiDi.Cdp.Tracing
Assembly
Selenium.WebDriver.BiDi.Cdp.dll
public interface ITracing

Properties

BufferUsage

[Experimental("BIDICDP001")]
IEventSource<BufferUsageEventArgs> BufferUsage { get; }

Property Value

IEventSource<BufferUsageEventArgs>

Remarks

Event args (BufferUsageEventArgs):

  • PercentFull - A number in range [0..1] that indicates the used size of event buffer as a fraction of its total size.
  • EventCount - An approximate number of events in the trace log.
  • Value - A number in range [0..1] that indicates the used size of event buffer as a fraction of its total size.

DataCollected

Contains a bucket of collected trace events. When tracing is stopped collected events will be sent as a sequence of dataCollected events followed by tracingComplete event.

[Experimental("BIDICDP001")]
IEventSource<DataCollectedEventArgs> DataCollected { get; }

Property Value

IEventSource<DataCollectedEventArgs>

Remarks

Event args (DataCollectedEventArgs):

  • Value

TracingComplete

Signals that tracing is stopped and there is no trace buffers pending flush, all data were delivered via dataCollected events.

IEventSource<TracingCompleteEventArgs> TracingComplete { get; }

Property Value

IEventSource<TracingCompleteEventArgs>

Remarks

Event args (TracingCompleteEventArgs):

  • DataLossOccurred - Indicates whether some trace data is known to have been lost, e.g. because the trace ring buffer wrapped around.
  • Stream - A handle of the stream that holds resulting trace data.
  • TraceFormat - Trace data format of returned stream.
  • StreamCompression - Compression format of returned stream.

Methods

EndAsync(string?, CancellationToken)

Stop trace events collection.

Task<EndResult> EndAsync(string? session = null, CancellationToken cancellationToken = default)

Parameters

session string

Optional CDP session override.

cancellationToken CancellationToken

A token to cancel the asynchronous operation.

Returns

Task<EndResult>

A task representing the asynchronous operation, containing a EndResult.

GetCategoriesAsync(string?, CancellationToken)

Gets supported tracing categories.

[Experimental("BIDICDP001")]
Task<GetCategoriesResult> GetCategoriesAsync(string? session = null, CancellationToken cancellationToken = default)

Parameters

session string

Optional CDP session override.

cancellationToken CancellationToken

A token to cancel the asynchronous operation.

Returns

Task<GetCategoriesResult>

A task representing the asynchronous operation, containing a GetCategoriesResult.

GetTrackEventDescriptorAsync(string?, CancellationToken)

Return a descriptor for all available tracing categories.

[Experimental("BIDICDP001")]
Task<GetTrackEventDescriptorResult> GetTrackEventDescriptorAsync(string? session = null, CancellationToken cancellationToken = default)

Parameters

session string

Optional CDP session override.

cancellationToken CancellationToken

A token to cancel the asynchronous operation.

Returns

Task<GetTrackEventDescriptorResult>

A task representing the asynchronous operation, containing a GetTrackEventDescriptorResult.

RecordClockSyncMarkerAsync(string, string?, CancellationToken)

Record a clock sync marker in the trace.

[Experimental("BIDICDP001")]
Task<RecordClockSyncMarkerResult> RecordClockSyncMarkerAsync(string syncId, string? session = null, CancellationToken cancellationToken = default)

Parameters

syncId string

The ID of this clock sync marker

session string

Optional CDP session override.

cancellationToken CancellationToken

A token to cancel the asynchronous operation.

Returns

Task<RecordClockSyncMarkerResult>

A task representing the asynchronous operation, containing a RecordClockSyncMarkerResult.

RequestMemoryDumpAsync(bool?, MemoryDumpLevelOfDetail?, string?, CancellationToken)

Request a global memory dump.

[Experimental("BIDICDP001")]
Task<RequestMemoryDumpResult> RequestMemoryDumpAsync(bool? deterministic = null, MemoryDumpLevelOfDetail? levelOfDetail = null, string? session = null, CancellationToken cancellationToken = default)

Parameters

deterministic bool?

Enables more deterministic results by forcing garbage collection

levelOfDetail MemoryDumpLevelOfDetail?

Specifies level of details in memory dump. Defaults to "detailed".

session string

Optional CDP session override.

cancellationToken CancellationToken

A token to cancel the asynchronous operation.

Returns

Task<RequestMemoryDumpResult>

A task representing the asynchronous operation, containing a RequestMemoryDumpResult.

StartAsync(string?, string?, double?, string?, StreamFormat?, StreamCompression?, TraceConfig?, string?, TracingBackend?, long?, long?, string?, CancellationToken)

Start trace events collection.

Task<StartResult> StartAsync(string? categories = null, string? options = null, double? bufferUsageReportingInterval = null, string? transferMode = null, StreamFormat? streamFormat = null, StreamCompression? streamCompression = null, TraceConfig? traceConfig = null, string? perfettoConfig = null, TracingBackend? tracingBackend = null, long? screenshotMaxSize = null, long? screenshotMaxCount = null, string? session = null, CancellationToken cancellationToken = default)

Parameters

categories string

Category/tag filter

options string

Tracing options

bufferUsageReportingInterval double?

If set, the agent will issue bufferUsage events at this interval, specified in milliseconds

transferMode string

Whether to report trace events as series of dataCollected events or to save trace to a stream (defaults to ReportEvents).

streamFormat StreamFormat?

Trace data format to use. This only applies when using ReturnAsStream transfer mode (defaults to json).

streamCompression StreamCompression?

Compression format to use. This only applies when using ReturnAsStream transfer mode (defaults to none)

traceConfig TraceConfig
perfettoConfig string

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)

tracingBackend TracingBackend?

Backend type (defaults to auto)

screenshotMaxSize long?

Maximum width and height (in pixels) of each captured screenshot. Only used when the disabled-by-default-devtools.screenshot category is enabled. Defaults to 500. The combined memory footprint of screenshots (screenshotMaxSize * screenshotMaxSize * 4 * screenshotMaxCount) is clamped to the existing per-session budget.

screenshotMaxCount long?

Maximum number of screenshots captured during a single tracing session. Only used when the disabled-by-default-devtools.screenshot category is enabled. Defaults to 450. Clamped together with screenshotMaxSize to stay within the per-session screenshot memory budget.

session string

Optional CDP session override.

cancellationToken CancellationToken

A token to cancel the asynchronous operation.

Returns

Task<StartResult>

A task representing the asynchronous operation, containing a StartResult.