heap_profiler
AddHeapSnapshotChunk
dataclass
Source code in zendriver/cdp/heap_profiler.py
HeapSnapshotObjectId
Bases: str
Heap snapshot object id.
Source code in zendriver/cdp/heap_profiler.py
__repr__()
from_json(json)
classmethod
HeapStatsUpdate
dataclass
If heap objects tracking has been started then backend may send update for one or more fragments
Source code in zendriver/cdp/heap_profiler.py
LastSeenObjectId
dataclass
If heap objects tracking has been started then backend regularly sends a current value for last seen object id and corresponding timestamp. If the were changes in the heap since last event then one or more heapStatsUpdate events will be sent before a new lastSeenObjectId event.
Source code in zendriver/cdp/heap_profiler.py
last_seen_object_id: int
instance-attribute
timestamp: float
instance-attribute
__init__(last_seen_object_id, timestamp)
ReportHeapSnapshotProgress
dataclass
Source code in zendriver/cdp/heap_profiler.py
done: int
instance-attribute
finished: typing.Optional[bool]
instance-attribute
total: int
instance-attribute
__init__(done, total, finished)
from_json(json)
classmethod
Source code in zendriver/cdp/heap_profiler.py
ResetProfiles
dataclass
Source code in zendriver/cdp/heap_profiler.py
SamplingHeapProfile
dataclass
Sampling profile.
Source code in zendriver/cdp/heap_profiler.py
head: SamplingHeapProfileNode
instance-attribute
samples: typing.List[SamplingHeapProfileSample]
instance-attribute
__init__(head, samples)
from_json(json)
classmethod
SamplingHeapProfileNode
dataclass
Sampling Heap Profile node. Holds callsite information, allocation statistics and child nodes.
Source code in zendriver/cdp/heap_profiler.py
call_frame: runtime.CallFrame
instance-attribute
children: typing.List[SamplingHeapProfileNode]
instance-attribute
id_: int
instance-attribute
self_size: float
instance-attribute
__init__(call_frame, self_size, id_, children)
from_json(json)
classmethod
Source code in zendriver/cdp/heap_profiler.py
to_json()
SamplingHeapProfileSample
dataclass
A single sample from a sampling profile.
Source code in zendriver/cdp/heap_profiler.py
node_id: int
instance-attribute
ordinal: float
instance-attribute
size: float
instance-attribute
__init__(size, node_id, ordinal)
from_json(json)
classmethod
add_inspected_heap_object(heap_object_id)
Enables console to refer to the node with given id via $x (see Command Line API for more details $x functions).
Parameters:
Name | Type | Description | Default |
---|---|---|---|
heap_object_id
|
HeapSnapshotObjectId
|
Heap snapshot object id to be accessible by means of $x command line API. |
required |
Source code in zendriver/cdp/heap_profiler.py
collect_garbage()
disable()
enable()
get_heap_object_id(object_id)
Parameters:
Name | Type | Description | Default |
---|---|---|---|
object_id
|
RemoteObjectId
|
Identifier of the object to get heap object id for. |
required |
Returns:
Type | Description |
---|---|
Generator[T_JSON_DICT, T_JSON_DICT, HeapSnapshotObjectId]
|
Id of the heap snapshot object corresponding to the passed remote object id. |
Source code in zendriver/cdp/heap_profiler.py
get_object_by_heap_object_id(object_id, object_group=None)
Parameters:
Name | Type | Description | Default |
---|---|---|---|
object_id
|
HeapSnapshotObjectId
|
|
required |
object_group
|
Optional[str]
|
(Optional) Symbolic group name that can be used to release multiple objects. |
None
|
Returns:
Type | Description |
---|---|
Generator[T_JSON_DICT, T_JSON_DICT, RemoteObject]
|
Evaluation result. |
Source code in zendriver/cdp/heap_profiler.py
get_sampling_profile()
Returns:
Type | Description |
---|---|
Generator[T_JSON_DICT, T_JSON_DICT, SamplingHeapProfile]
|
Return the sampling profile being collected. |
Source code in zendriver/cdp/heap_profiler.py
start_sampling(sampling_interval=None, include_objects_collected_by_major_gc=None, include_objects_collected_by_minor_gc=None)
Parameters:
Name | Type | Description | Default |
---|---|---|---|
sampling_interval
|
Optional[float]
|
(Optional) Average sample interval in bytes. Poisson distribution is used for the intervals. The default value is 32768 bytes. |
None
|
include_objects_collected_by_major_gc
|
Optional[bool]
|
(Optional) By default, the sampling heap profiler reports only objects which are still alive when the profile is returned via getSamplingProfile or stopSampling, which is useful for determining what functions contribute the most to steady-state memory usage. This flag instructs the sampling heap profiler to also include information about objects discarded by major GC, which will show which functions cause large temporary memory usage or long GC pauses. |
None
|
include_objects_collected_by_minor_gc
|
Optional[bool]
|
(Optional) By default, the sampling heap profiler reports only objects which are still alive when the profile is returned via getSamplingProfile or stopSampling, which is useful for determining what functions contribute the most to steady-state memory usage. This flag instructs the sampling heap profiler to also include information about objects discarded by minor GC, which is useful when tuning a latency-sensitive application for minimal GC activity. |
None
|
Source code in zendriver/cdp/heap_profiler.py
start_tracking_heap_objects(track_allocations=None)
Parameters:
Name | Type | Description | Default |
---|---|---|---|
track_allocations
|
Optional[bool]
|
(Optional) |
None
|
Source code in zendriver/cdp/heap_profiler.py
stop_sampling()
Returns:
Type | Description |
---|---|
Generator[T_JSON_DICT, T_JSON_DICT, SamplingHeapProfile]
|
Recorded sampling heap profile. |
Source code in zendriver/cdp/heap_profiler.py
stop_tracking_heap_objects(report_progress=None, treat_global_objects_as_roots=None, capture_numeric_value=None, expose_internals=None)
Parameters:
Name | Type | Description | Default |
---|---|---|---|
report_progress
|
Optional[bool]
|
(Optional) If true 'reportHeapSnapshotProgress' events will be generated while snapshot is being taken when the tracking is stopped. |
None
|
treat_global_objects_as_roots
|
Optional[bool]
|
(DEPRECATED) (Optional) Deprecated in favor of |
None
|
capture_numeric_value
|
Optional[bool]
|
(Optional) If true, numerical values are included in the snapshot |
None
|
expose_internals
|
Optional[bool]
|
(EXPERIMENTAL) (Optional) If true, exposes internals of the snapshot. |
None
|
Source code in zendriver/cdp/heap_profiler.py
take_heap_snapshot(report_progress=None, treat_global_objects_as_roots=None, capture_numeric_value=None, expose_internals=None)
Parameters:
Name | Type | Description | Default |
---|---|---|---|
report_progress
|
Optional[bool]
|
(Optional) If true 'reportHeapSnapshotProgress' events will be generated while snapshot is being taken. |
None
|
treat_global_objects_as_roots
|
Optional[bool]
|
(DEPRECATED) (Optional) If true, a raw snapshot without artificial roots will be generated. Deprecated in favor of |
None
|
capture_numeric_value
|
Optional[bool]
|
(Optional) If true, numerical values are included in the snapshot |
None
|
expose_internals
|
Optional[bool]
|
(EXPERIMENTAL) (Optional) If true, exposes internals of the snapshot. |
None
|