PerformanceTimeline

Reporting of performance timeline events, as specified in https://w3c.github.io/performance-timeline/#dom-performanceobserver.

Constructors

Link copied to clipboard
constructor(cdp: CDP)

Types

Link copied to clipboard
@Serializable
data class EnableParameter(val eventTypes: List<String>)
Link copied to clipboard
@Serializable
data class LargestContentfulPaint(val renderTime: Double, val loadTime: Double, val size: Double, val elementId: String? = null, val url: String? = null, val nodeId: Int? = null)

See https://github.com/WICG/LargestContentfulPaint and largest_contentful_paint.idl

Link copied to clipboard
@Serializable
data class LayoutShift(val value: Double, val hadRecentInput: Boolean, val lastInputTime: Double, val sources: List<PerformanceTimeline.LayoutShiftAttribution>)

See https://wicg.github.io/layout-instability/#sec-layout-shift and layout_shift.idl

Link copied to clipboard
@Serializable
data class LayoutShiftAttribution(val previousRect: DOM.Rect, val currentRect: DOM.Rect, val nodeId: Int? = null)
Link copied to clipboard
@Serializable
data class TimelineEvent(val frameId: String, val type: String, val name: String, val time: Double, val duration: Double? = null, val lcpDetails: PerformanceTimeline.LargestContentfulPaint? = null, val layoutShiftDetails: PerformanceTimeline.LayoutShift? = null)
Link copied to clipboard

Sent when a performance timeline event is added. See reportPerformanceTimeline method.

Properties

Link copied to clipboard

Sent when a performance timeline event is added. See reportPerformanceTimeline method.

Functions

Link copied to clipboard
suspend fun enable(eventTypes: List<String>)
suspend fun enable(args: PerformanceTimeline.EnableParameter, mode: CommandMode = CommandMode.DEFAULT)

Previously buffered events would be reported before method returns. See also: timelineEventAdded