Tracing¶
This CDP domain is experimental.
Types¶
Generally, you do not need to instantiate CDP types yourself. Instead, the API creates objects for you as return values from commands, and then you can use those objects as arguments to other commands.
-
class
cdp.tracing.
MemoryDumpConfig
¶ Configuration for memory dump. Used only when “memory-infra” category is enabled.
-
class
cdp.tracing.
TraceConfig
(record_mode=None, enable_sampling=None, enable_systrace=None, enable_argument_filter=None, included_categories=None, excluded_categories=None, synthetic_delays=None, memory_dump_config=None)¶ -
enable_argument_filter
= None¶ Turns on argument filter.
-
enable_sampling
= None¶ Turns on JavaScript stack sampling.
-
enable_systrace
= None¶ Turns on system tracing.
-
excluded_categories
= None¶ Excluded category filters.
-
included_categories
= None¶ Included category filters.
-
memory_dump_config
= None¶ Configuration for memory dump triggers. Used only when “memory-infra” category is enabled.
-
record_mode
= None¶ Controls how the trace buffer stores data.
-
synthetic_delays
= None¶ Configuration to synthesize the delays in tracing.
-
Commands¶
Each command is a generator function. The return
type Generator[x, y, z]
indicates that the generator
yields arguments of type x
, it must be resumed with
an argument of type y
, and it returns type z
. In
this library, types x
and y
are the same for all
commands, and z
is the return type you should pay attention
to. For more information, see
Getting Started: Commands.
-
cdp.tracing.
end
()¶ Stop trace events collection.
Return type: Generator
[Dict
[str
,Any
],Dict
[str
,Any
],None
]
-
cdp.tracing.
get_categories
()¶ Gets supported tracing categories.
Return type: Generator
[Dict
[str
,Any
],Dict
[str
,Any
],List
[str
]]Returns: A list of supported tracing categories.
-
cdp.tracing.
record_clock_sync_marker
(sync_id)¶ Record a clock sync marker in the trace.
Parameters: sync_id ( str
) – The ID of this clock sync markerReturn type: Generator
[Dict
[str
,Any
],Dict
[str
,Any
],None
]
-
cdp.tracing.
request_memory_dump
()¶ Request a global memory dump.
Return type: Generator
[Dict
[str
,Any
],Dict
[str
,Any
],Tuple
[str
,bool
]]Returns: A tuple with the following items: - dumpGuid - GUID of the resulting global memory dump.
- success - True iff the global memory dump succeeded.
-
cdp.tracing.
start
(categories=None, options=None, buffer_usage_reporting_interval=None, transfer_mode=None, stream_format=None, stream_compression=None, trace_config=None)¶ Start trace events collection.
Parameters: - categories (
Optional
[str
]) – (DEPRECATED) (Optional) Category/tag filter - options (
Optional
[str
]) – (DEPRECATED) (Optional) Tracing options - buffer_usage_reporting_interval (
Optional
[float
]) – (Optional) If set, the agent will issue bufferUsage events at this interval, specified in milliseconds - transfer_mode (
Optional
[str
]) – (Optional) Whether to report trace events as series of dataCollected events or to save trace to a stream (defaults to`ReportEvents``
). - stream_format (
Optional
[StreamFormat
]) – (Optional) Trace data format to use. This only applies when using``ReturnAsStream``
transfer mode (defaults to``json``
). - stream_compression (
Optional
[StreamCompression
]) – (Optional) Compression format to use. This only applies when using``ReturnAsStream``
transfer mode (defaults to``none`
) - trace_config (
Optional
[TraceConfig
]) – (Optional)
Return type: Generator
[Dict
[str
,Any
],Dict
[str
,Any
],None
]- categories (
Events¶
Generally, you do not need to instantiate CDP events yourself. Instead, the API creates events for you and then you use the event’s attributes.
-
class
cdp.tracing.
BufferUsage
(percent_full, event_count, value)¶ -
event_count
= None¶ An approximate number of events in the trace log.
-
percent_full
= None¶ A number in range [0..1] that indicates the used size of event buffer as a fraction of its total size.
-
value
= None¶ A number in range [0..1] that indicates the used size of event buffer as a fraction of its total size.
-
-
class
cdp.tracing.
DataCollected
(value)¶ Contains an bucket of collected trace events. When tracing is stopped collected events will be send as a sequence of dataCollected events followed by tracingComplete event.
-
class
cdp.tracing.
TracingComplete
(data_loss_occurred, stream, trace_format, stream_compression)¶ Signals that tracing is stopped and there is no trace buffers pending flush, all data were delivered via dataCollected events.
-
data_loss_occurred
= None¶ Indicates whether some trace data is known to have been lost, e.g. because the trace ring buffer wrapped around.
-
stream
= None¶ A handle of the stream that holds resulting trace data.
-
stream_compression
= None¶ Compression format of returned stream.
-
trace_format
= None¶ Trace data format of returned stream.
-