performancetimeline

package
v0.3.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 27, 2026 License: MIT, MIT Imports: 3 Imported by: 0

Documentation

Overview

Package performancetimeline provides the Chrome DevTools Protocol commands, types, and events for the PerformanceTimeline domain.

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

Generated by the cdproto-gen command.

Index

Constants

View Source
const (
	CommandEnable = "PerformanceTimeline.enable"
)

Command names.

Variables

This section is empty.

Functions

This section is empty.

Types

type EnableParams

type EnableParams struct {
	EventTypes []string `json:"eventTypes"` // 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.
}

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

func Enable

func Enable(eventTypes []string) *EnableParams

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

See: https://chromedevtools.github.io/devtools-protocol/tot/PerformanceTimeline#method-enable

parameters:

eventTypes - 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.

func (*EnableParams) Do

func (p *EnableParams) Do(ctx context.Context) (err error)

Do executes PerformanceTimeline.enable against the provided context.

type EventTimelineEventAdded

type EventTimelineEventAdded struct {
	Event *TimelineEvent `json:"event"`
}

EventTimelineEventAdded sent when a performance timeline event is added. See reportPerformanceTimeline method.

See: https://chromedevtools.github.io/devtools-protocol/tot/PerformanceTimeline#event-timelineEventAdded

type LargestContentfulPaint

type LargestContentfulPaint struct {
	RenderTime *cdp.TimeSinceEpoch `json:"renderTime"`
	LoadTime   *cdp.TimeSinceEpoch `json:"loadTime"`
	Size       float64             `json:"size"`                // The number of pixels being painted.
	ElementID  string              `json:"elementId,omitempty"` // The id attribute of the element, if available.
	URL        string              `json:"url,omitempty"`       // The URL of the image (may be trimmed).
	NodeID     cdp.BackendNodeID   `json:"nodeId,omitempty"`
}

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

See: https://chromedevtools.github.io/devtools-protocol/tot/PerformanceTimeline#type-LargestContentfulPaint

type LayoutShift

type LayoutShift struct {
	Value          float64                   `json:"value"` // Score increment produced by this event.
	HadRecentInput bool                      `json:"hadRecentInput"`
	LastInputTime  *cdp.TimeSinceEpoch       `json:"lastInputTime"`
	Sources        []*LayoutShiftAttribution `json:"sources"`
}

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

See: https://chromedevtools.github.io/devtools-protocol/tot/PerformanceTimeline#type-LayoutShift

type LayoutShiftAttribution

type LayoutShiftAttribution struct {
	PreviousRect *dom.Rect         `json:"previousRect"`
	CurrentRect  *dom.Rect         `json:"currentRect"`
	NodeID       cdp.BackendNodeID `json:"nodeId,omitempty"`
}

LayoutShiftAttribution [no description].

See: https://chromedevtools.github.io/devtools-protocol/tot/PerformanceTimeline#type-LayoutShiftAttribution

type TimelineEvent

type TimelineEvent struct {
	FrameID            cdp.FrameID             `json:"frameId"`            // Identifies the frame that this event is related to. Empty for non-frame targets.
	Type               string                  `json:"type"`               // The event type, as specified in https://w3c.github.io/performance-timeline/#dom-performanceentry-entrytype This determines which of the optional "details" fields is present.
	Name               string                  `json:"name"`               // Name may be empty depending on the type.
	Time               *cdp.TimeSinceEpoch     `json:"time"`               // Time in seconds since Epoch, monotonically increasing within document lifetime.
	Duration           float64                 `json:"duration,omitempty"` // Event duration, if applicable.
	LcpDetails         *LargestContentfulPaint `json:"lcpDetails,omitempty"`
	LayoutShiftDetails *LayoutShift            `json:"layoutShiftDetails,omitempty"`
}

TimelineEvent [no description].

See: https://chromedevtools.github.io/devtools-protocol/tot/PerformanceTimeline#type-TimelineEvent

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL