PerformanceTimeline#
Reporting of performance timeline events, as specified in https://w3c.github.io/performance-timeline/#dom-performanceobserver.
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 LargestContentfulPaint(render_time, load_time, size, element_id=None, url=None, node_id=None)[source]#
See https://github.com/WICG/LargestContentfulPaint and largest_contentful_paint.idl
-
render_time:
TimeSinceEpoch#
-
load_time:
TimeSinceEpoch#
-
node_id:
Optional[BackendNodeId] = None#
-
render_time:
- class LayoutShiftAttribution(previous_rect, current_rect, node_id=None)[source]#
-
-
node_id:
Optional[BackendNodeId] = None#
-
node_id:
- class LayoutShift(value, had_recent_input, last_input_time, sources)[source]#
See https://wicg.github.io/layout-instability/#sec-layout-shift and layout_shift.idl
-
last_input_time:
TimeSinceEpoch#
-
sources:
List[LayoutShiftAttribution]#
-
last_input_time:
- class TimelineEvent(frame_id, type_, name, time, duration=None, lcp_details=None, layout_shift_details=None)[source]#
-
-
type_:
str# //w3c.github.io/performance-timeline/#dom-performanceentry-entrytype This determines which of the optional “details” fields is present.
- Type:
The event type, as specified in https
-
time:
TimeSinceEpoch# Time in seconds since Epoch, monotonically increasing within document lifetime.
-
lcp_details:
Optional[LargestContentfulPaint] = None#
-
layout_shift_details:
Optional[LayoutShift] = None#
-
type_:
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.
- enable(event_types)[source]#
Previously buffered events would be reported before method returns. See also: timelineEventAdded
- Parameters:
event_types (
List[str]) – The types of event to report, as specified in https://w3c.github.io/performance-timeline/#dom-performanceentry-entrytype The specified filter overrides any previous filters, passing empty filter disables recording. Note that not all types exposed to the web platform are currently supported.- Return type:
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 TimelineEventAdded(event)[source]#
Sent when a performance timeline event is added. See reportPerformanceTimeline method.
-
event:
TimelineEvent#
-
event: