Interface ITracing
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
sessionstringOptional CDP session override.
cancellationTokenCancellationTokenA token to cancel the asynchronous operation.
Returns
GetCategoriesAsync(string?, CancellationToken)
Gets supported tracing categories.
[Experimental("BIDICDP001")]
Task<GetCategoriesResult> GetCategoriesAsync(string? session = null, CancellationToken cancellationToken = default)
Parameters
sessionstringOptional CDP session override.
cancellationTokenCancellationTokenA 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
sessionstringOptional CDP session override.
cancellationTokenCancellationTokenA 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
syncIdstringThe ID of this clock sync marker
sessionstringOptional CDP session override.
cancellationTokenCancellationTokenA 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
deterministicbool?Enables more deterministic results by forcing garbage collection
levelOfDetailMemoryDumpLevelOfDetail?Specifies level of details in memory dump. Defaults to "detailed".
sessionstringOptional CDP session override.
cancellationTokenCancellationTokenA 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
categoriesstringCategory/tag filter
optionsstringTracing options
bufferUsageReportingIntervaldouble?If set, the agent will issue bufferUsage events at this interval, specified in milliseconds
transferModestringWhether to report trace events as series of dataCollected events or to save trace to a stream (defaults to ReportEvents).
streamFormatStreamFormat?Trace data format to use. This only applies when using ReturnAsStream transfer mode (defaults to json).
streamCompressionStreamCompression?Compression format to use. This only applies when using ReturnAsStream transfer mode (defaults to none)
traceConfigTraceConfigperfettoConfigstringBase64-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)
tracingBackendTracingBackend?Backend type (defaults to auto)
screenshotMaxSizelong?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.
screenshotMaxCountlong?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.
sessionstringOptional CDP session override.
cancellationTokenCancellationTokenA token to cancel the asynchronous operation.
Returns
- Task<StartResult>
A task representing the asynchronous operation, containing a StartResult.