tracing
BufferUsage
dataclass
EXPERIMENTAL
Source code in zendriver/cdp/tracing.py
event_count: typing.Optional[float]
instance-attribute
percent_full: typing.Optional[float]
instance-attribute
value: typing.Optional[float]
instance-attribute
__init__(percent_full, event_count, value)
from_json(json)
classmethod
Source code in zendriver/cdp/tracing.py
DataCollected
dataclass
EXPERIMENTAL
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.
Source code in zendriver/cdp/tracing.py
MemoryDumpConfig
Bases: dict
Configuration for memory dump. Used only when "memory-infra" category is enabled.
Source code in zendriver/cdp/tracing.py
__repr__()
from_json(json)
classmethod
MemoryDumpLevelOfDetail
Bases: Enum
Details exposed when memory request explicitly declared. Keep consistent with memory_dump_request_args.h and memory_instrumentation.mojom
Source code in zendriver/cdp/tracing.py
BACKGROUND = 'background'
class-attribute
instance-attribute
DETAILED = 'detailed'
class-attribute
instance-attribute
LIGHT = 'light'
class-attribute
instance-attribute
from_json(json)
classmethod
StreamCompression
Bases: Enum
Compression type to use for traces returned via streams.
Source code in zendriver/cdp/tracing.py
GZIP = 'gzip'
class-attribute
instance-attribute
NONE = 'none'
class-attribute
instance-attribute
from_json(json)
classmethod
StreamFormat
Bases: Enum
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.
Source code in zendriver/cdp/tracing.py
JSON = 'json'
class-attribute
instance-attribute
PROTO = 'proto'
class-attribute
instance-attribute
from_json(json)
classmethod
TraceConfig
dataclass
Source code in zendriver/cdp/tracing.py
enable_argument_filter: typing.Optional[bool] = None
class-attribute
instance-attribute
enable_sampling: typing.Optional[bool] = None
class-attribute
instance-attribute
enable_systrace: typing.Optional[bool] = None
class-attribute
instance-attribute
excluded_categories: typing.Optional[typing.List[str]] = None
class-attribute
instance-attribute
included_categories: typing.Optional[typing.List[str]] = None
class-attribute
instance-attribute
memory_dump_config: typing.Optional[MemoryDumpConfig] = None
class-attribute
instance-attribute
record_mode: typing.Optional[str] = None
class-attribute
instance-attribute
synthetic_delays: typing.Optional[typing.List[str]] = None
class-attribute
instance-attribute
trace_buffer_size_in_kb: typing.Optional[float] = None
class-attribute
instance-attribute
__init__(record_mode=None, trace_buffer_size_in_kb=None, enable_sampling=None, enable_systrace=None, enable_argument_filter=None, included_categories=None, excluded_categories=None, synthetic_delays=None, memory_dump_config=None)
from_json(json)
classmethod
Source code in zendriver/cdp/tracing.py
to_json()
Source code in zendriver/cdp/tracing.py
TracingBackend
Bases: Enum
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
.
Source code in zendriver/cdp/tracing.py
AUTO = 'auto'
class-attribute
instance-attribute
CHROME = 'chrome'
class-attribute
instance-attribute
SYSTEM = 'system'
class-attribute
instance-attribute
from_json(json)
classmethod
TracingComplete
dataclass
Signals that tracing is stopped and there is no trace buffers pending flush, all data were delivered via dataCollected events.
Source code in zendriver/cdp/tracing.py
data_loss_occurred: bool
instance-attribute
stream: typing.Optional[io.StreamHandle]
instance-attribute
stream_compression: typing.Optional[StreamCompression]
instance-attribute
trace_format: typing.Optional[StreamFormat]
instance-attribute
__init__(data_loss_occurred, stream, trace_format, stream_compression)
from_json(json)
classmethod
Source code in zendriver/cdp/tracing.py
end()
get_categories()
Gets supported tracing categories.
EXPERIMENTAL
Returns:
Type | Description |
---|---|
Generator[T_JSON_DICT, T_JSON_DICT, List[str]]
|
A list of supported tracing categories. |
Source code in zendriver/cdp/tracing.py
record_clock_sync_marker(sync_id)
Record a clock sync marker in the trace.
EXPERIMENTAL
Parameters:
Name | Type | Description | Default |
---|---|---|---|
sync_id
|
str
|
The ID of this clock sync marker |
required |
Source code in zendriver/cdp/tracing.py
request_memory_dump(deterministic=None, level_of_detail=None)
Request a global memory dump.
EXPERIMENTAL
Parameters:
Name | Type | Description | Default |
---|---|---|---|
deterministic
|
Optional[bool]
|
(Optional) Enables more deterministic results by forcing garbage collection |
None
|
level_of_detail
|
Optional[MemoryDumpLevelOfDetail]
|
(Optional) Specifies level of details in memory dump. Defaults to "detailed". |
None
|
Returns:
Type | Description |
---|---|
Generator[T_JSON_DICT, T_JSON_DICT, Tuple[str, bool]]
|
A tuple with the following items: 0. dumpGuid - GUID of the resulting global memory dump. 1. success - True iff the global memory dump succeeded. |
Source code in zendriver/cdp/tracing.py
start(categories=None, options=None, buffer_usage_reporting_interval=None, transfer_mode=None, stream_format=None, stream_compression=None, trace_config=None, perfetto_config=None, tracing_backend=None)
Start trace events collection.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
categories
|
Optional[str]
|
(DEPRECATED) (EXPERIMENTAL) (Optional) Category/tag filter |
None
|
options
|
Optional[str]
|
(DEPRECATED) (EXPERIMENTAL) (Optional) Tracing options |
None
|
buffer_usage_reporting_interval
|
Optional[float]
|
(EXPERIMENTAL) (Optional) If set, the agent will issue bufferUsage events at this interval, specified in milliseconds |
None
|
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````). |
None
|
stream_format
|
Optional[StreamFormat]
|
(Optional) Trace data format to use. This only applies when using |
None
|
stream_compression
|
Optional[StreamCompression]
|
(EXPERIMENTAL) (Optional) Compression format to use. This only applies when using |
None
|
trace_config
|
Optional[TraceConfig]
|
(Optional) |
None
|
perfetto_config
|
Optional[str]
|
(EXPERIMENTAL) (Optional) Base64-encoded serialized perfetto.protos.TraceConfig protobuf message When specified, the parameters |
None
|
tracing_backend
|
Optional[TracingBackend]
|
(EXPERIMENTAL) (Optional) Backend type (defaults to |
None
|