vendor/github.com/go-rod/rod/lib/proto/performance_timeline.go

115 lines · 3851 bytes

  1// This file is generated by "./lib/proto/generate"
  2
  3package proto
  4
  5/*
  6
  7PerformanceTimeline
  8
  9Reporting of performance timeline events, as specified in
 10https://w3c.github.io/performance-timeline/#dom-performanceobserver.
 11
 12*/
 13
 14// PerformanceTimelineLargestContentfulPaint See https://github.com/WICG/LargestContentfulPaint and largest_contentful_paint.idl.
 15type PerformanceTimelineLargestContentfulPaint struct {
 16	// RenderTime ...
 17	RenderTime TimeSinceEpoch `json:"renderTime"`
 18
 19	// LoadTime ...
 20	LoadTime TimeSinceEpoch `json:"loadTime"`
 21
 22	// Size The number of pixels being painted.
 23	Size float64 `json:"size"`
 24
 25	// ElementID (optional) The id attribute of the element, if available.
 26	ElementID string `json:"elementId,omitempty"`
 27
 28	// URL (optional) The URL of the image (may be trimmed).
 29	URL string `json:"url,omitempty"`
 30
 31	// NodeID (optional) ...
 32	NodeID DOMBackendNodeID `json:"nodeId,omitempty"`
 33}
 34
 35// PerformanceTimelineLayoutShiftAttribution ...
 36type PerformanceTimelineLayoutShiftAttribution struct {
 37	// PreviousRect ...
 38	PreviousRect *DOMRect `json:"previousRect"`
 39
 40	// CurrentRect ...
 41	CurrentRect *DOMRect `json:"currentRect"`
 42
 43	// NodeID (optional) ...
 44	NodeID DOMBackendNodeID `json:"nodeId,omitempty"`
 45}
 46
 47// PerformanceTimelineLayoutShift See https://wicg.github.io/layout-instability/#sec-layout-shift and layout_shift.idl.
 48type PerformanceTimelineLayoutShift struct {
 49	// Value Score increment produced by this event.
 50	Value float64 `json:"value"`
 51
 52	// HadRecentInput ...
 53	HadRecentInput bool `json:"hadRecentInput"`
 54
 55	// LastInputTime ...
 56	LastInputTime TimeSinceEpoch `json:"lastInputTime"`
 57
 58	// Sources ...
 59	Sources []*PerformanceTimelineLayoutShiftAttribution `json:"sources"`
 60}
 61
 62// PerformanceTimelineTimelineEvent ...
 63type PerformanceTimelineTimelineEvent struct {
 64	// FrameID Identifies the frame that this event is related to. Empty for non-frame targets.
 65	FrameID PageFrameID `json:"frameId"`
 66
 67	// Type The event type, as specified in https://w3c.github.io/performance-timeline/#dom-performanceentry-entrytype
 68	// This determines which of the optional "details" fields is present.
 69	Type string `json:"type"`
 70
 71	// Name may be empty depending on the type.
 72	Name string `json:"name"`
 73
 74	// Time in seconds since Epoch, monotonically increasing within document lifetime.
 75	Time TimeSinceEpoch `json:"time"`
 76
 77	// Duration (optional) Event duration, if applicable.
 78	Duration *float64 `json:"duration,omitempty"`
 79
 80	// LcpDetails (optional) ...
 81	LcpDetails *PerformanceTimelineLargestContentfulPaint `json:"lcpDetails,omitempty"`
 82
 83	// LayoutShiftDetails (optional) ...
 84	LayoutShiftDetails *PerformanceTimelineLayoutShift `json:"layoutShiftDetails,omitempty"`
 85}
 86
 87// PerformanceTimelineEnable Previously buffered events would be reported before method returns.
 88// See also: timelineEventAdded.
 89type PerformanceTimelineEnable struct {
 90	// EventTypes The types of event to report, as specified in
 91	// https://w3c.github.io/performance-timeline/#dom-performanceentry-entrytype
 92	// The specified filter overrides any previous filters, passing empty
 93	// filter disables recording.
 94	// Note that not all types exposed to the web platform are currently supported.
 95	EventTypes []string `json:"eventTypes"`
 96}
 97
 98// ProtoReq name.
 99func (m PerformanceTimelineEnable) ProtoReq() string { return "PerformanceTimeline.enable" }
100
101// Call sends the request.
102func (m PerformanceTimelineEnable) Call(c Client) error {
103	return call(m.ProtoReq(), m, nil, c)
104}
105
106// PerformanceTimelineTimelineEventAdded Sent when a performance timeline event is added. See reportPerformanceTimeline method.
107type PerformanceTimelineTimelineEventAdded struct {
108	// Event ...
109	Event *PerformanceTimelineTimelineEvent `json:"event"`
110}
111
112// ProtoEvent name.
113func (evt PerformanceTimelineTimelineEventAdded) ProtoEvent() string {
114	return "PerformanceTimeline.timelineEventAdded"
115}