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

299 lines · 9961 bytes

  1// This file is generated by "./lib/proto/generate"
  2
  3package proto
  4
  5/*
  6
  7Profiler
  8
  9*/
 10
 11// ProfilerProfileNode Profile node. Holds callsite information, execution statistics and child nodes.
 12type ProfilerProfileNode struct {
 13	// ID Unique id of the node.
 14	ID int `json:"id"`
 15
 16	// CallFrame Function location.
 17	CallFrame *RuntimeCallFrame `json:"callFrame"`
 18
 19	// HitCount (optional) Number of samples where this node was on top of the call stack.
 20	HitCount *int `json:"hitCount,omitempty"`
 21
 22	// Children (optional) Child node ids.
 23	Children []int `json:"children,omitempty"`
 24
 25	// DeoptReason (optional) The reason of being not optimized. The function may be deoptimized or marked as don't
 26	// optimize.
 27	DeoptReason string `json:"deoptReason,omitempty"`
 28
 29	// PositionTicks (optional) An array of source position ticks.
 30	PositionTicks []*ProfilerPositionTickInfo `json:"positionTicks,omitempty"`
 31}
 32
 33// ProfilerProfile Profile.
 34type ProfilerProfile struct {
 35	// Nodes The list of profile nodes. First item is the root node.
 36	Nodes []*ProfilerProfileNode `json:"nodes"`
 37
 38	// StartTime Profiling start timestamp in microseconds.
 39	StartTime float64 `json:"startTime"`
 40
 41	// EndTime Profiling end timestamp in microseconds.
 42	EndTime float64 `json:"endTime"`
 43
 44	// Samples (optional) Ids of samples top nodes.
 45	Samples []int `json:"samples,omitempty"`
 46
 47	// TimeDeltas (optional) Time intervals between adjacent samples in microseconds. The first delta is relative to the
 48	// profile startTime.
 49	TimeDeltas []int `json:"timeDeltas,omitempty"`
 50}
 51
 52// ProfilerPositionTickInfo Specifies a number of samples attributed to a certain source position.
 53type ProfilerPositionTickInfo struct {
 54	// Line Source line number (1-based).
 55	Line int `json:"line"`
 56
 57	// Ticks Number of samples attributed to the source line.
 58	Ticks int `json:"ticks"`
 59}
 60
 61// ProfilerCoverageRange Coverage data for a source range.
 62type ProfilerCoverageRange struct {
 63	// StartOffset JavaScript script source offset for the range start.
 64	StartOffset int `json:"startOffset"`
 65
 66	// EndOffset JavaScript script source offset for the range end.
 67	EndOffset int `json:"endOffset"`
 68
 69	// Count Collected execution count of the source range.
 70	Count int `json:"count"`
 71}
 72
 73// ProfilerFunctionCoverage Coverage data for a JavaScript function.
 74type ProfilerFunctionCoverage struct {
 75	// FunctionName JavaScript function name.
 76	FunctionName string `json:"functionName"`
 77
 78	// Ranges Source ranges inside the function with coverage data.
 79	Ranges []*ProfilerCoverageRange `json:"ranges"`
 80
 81	// IsBlockCoverage Whether coverage data for this function has block granularity.
 82	IsBlockCoverage bool `json:"isBlockCoverage"`
 83}
 84
 85// ProfilerScriptCoverage Coverage data for a JavaScript script.
 86type ProfilerScriptCoverage struct {
 87	// ScriptID JavaScript script id.
 88	ScriptID RuntimeScriptID `json:"scriptId"`
 89
 90	// URL JavaScript script name or url.
 91	URL string `json:"url"`
 92
 93	// Functions contained in the script that has coverage data.
 94	Functions []*ProfilerFunctionCoverage `json:"functions"`
 95}
 96
 97// ProfilerDisable ...
 98type ProfilerDisable struct{}
 99
100// ProtoReq name.
101func (m ProfilerDisable) ProtoReq() string { return "Profiler.disable" }
102
103// Call sends the request.
104func (m ProfilerDisable) Call(c Client) error {
105	return call(m.ProtoReq(), m, nil, c)
106}
107
108// ProfilerEnable ...
109type ProfilerEnable struct{}
110
111// ProtoReq name.
112func (m ProfilerEnable) ProtoReq() string { return "Profiler.enable" }
113
114// Call sends the request.
115func (m ProfilerEnable) Call(c Client) error {
116	return call(m.ProtoReq(), m, nil, c)
117}
118
119// ProfilerGetBestEffortCoverage Collect coverage data for the current isolate. The coverage data may be incomplete due to
120// garbage collection.
121type ProfilerGetBestEffortCoverage struct{}
122
123// ProtoReq name.
124func (m ProfilerGetBestEffortCoverage) ProtoReq() string { return "Profiler.getBestEffortCoverage" }
125
126// Call the request.
127func (m ProfilerGetBestEffortCoverage) Call(c Client) (*ProfilerGetBestEffortCoverageResult, error) {
128	var res ProfilerGetBestEffortCoverageResult
129	return &res, call(m.ProtoReq(), m, &res, c)
130}
131
132// ProfilerGetBestEffortCoverageResult ...
133type ProfilerGetBestEffortCoverageResult struct {
134	// Result Coverage data for the current isolate.
135	Result []*ProfilerScriptCoverage `json:"result"`
136}
137
138// ProfilerSetSamplingInterval Changes CPU profiler sampling interval. Must be called before CPU profiles recording started.
139type ProfilerSetSamplingInterval struct {
140	// Interval New sampling interval in microseconds.
141	Interval int `json:"interval"`
142}
143
144// ProtoReq name.
145func (m ProfilerSetSamplingInterval) ProtoReq() string { return "Profiler.setSamplingInterval" }
146
147// Call sends the request.
148func (m ProfilerSetSamplingInterval) Call(c Client) error {
149	return call(m.ProtoReq(), m, nil, c)
150}
151
152// ProfilerStart ...
153type ProfilerStart struct{}
154
155// ProtoReq name.
156func (m ProfilerStart) ProtoReq() string { return "Profiler.start" }
157
158// Call sends the request.
159func (m ProfilerStart) Call(c Client) error {
160	return call(m.ProtoReq(), m, nil, c)
161}
162
163// ProfilerStartPreciseCoverage Enable precise code coverage. Coverage data for JavaScript executed before enabling precise code
164// coverage may be incomplete. Enabling prevents running optimized code and resets execution
165// counters.
166type ProfilerStartPreciseCoverage struct {
167	// CallCount (optional) Collect accurate call counts beyond simple 'covered' or 'not covered'.
168	CallCount bool `json:"callCount,omitempty"`
169
170	// Detailed (optional) Collect block-based coverage.
171	Detailed bool `json:"detailed,omitempty"`
172
173	// AllowTriggeredUpdates (optional) Allow the backend to send updates on its own initiative
174	AllowTriggeredUpdates bool `json:"allowTriggeredUpdates,omitempty"`
175}
176
177// ProtoReq name.
178func (m ProfilerStartPreciseCoverage) ProtoReq() string { return "Profiler.startPreciseCoverage" }
179
180// Call the request.
181func (m ProfilerStartPreciseCoverage) Call(c Client) (*ProfilerStartPreciseCoverageResult, error) {
182	var res ProfilerStartPreciseCoverageResult
183	return &res, call(m.ProtoReq(), m, &res, c)
184}
185
186// ProfilerStartPreciseCoverageResult ...
187type ProfilerStartPreciseCoverageResult struct {
188	// Timestamp Monotonically increasing time (in seconds) when the coverage update was taken in the backend.
189	Timestamp float64 `json:"timestamp"`
190}
191
192// ProfilerStop ...
193type ProfilerStop struct{}
194
195// ProtoReq name.
196func (m ProfilerStop) ProtoReq() string { return "Profiler.stop" }
197
198// Call the request.
199func (m ProfilerStop) Call(c Client) (*ProfilerStopResult, error) {
200	var res ProfilerStopResult
201	return &res, call(m.ProtoReq(), m, &res, c)
202}
203
204// ProfilerStopResult ...
205type ProfilerStopResult struct {
206	// Profile Recorded profile.
207	Profile *ProfilerProfile `json:"profile"`
208}
209
210// ProfilerStopPreciseCoverage Disable precise code coverage. Disabling releases unnecessary execution count records and allows
211// executing optimized code.
212type ProfilerStopPreciseCoverage struct{}
213
214// ProtoReq name.
215func (m ProfilerStopPreciseCoverage) ProtoReq() string { return "Profiler.stopPreciseCoverage" }
216
217// Call sends the request.
218func (m ProfilerStopPreciseCoverage) Call(c Client) error {
219	return call(m.ProtoReq(), m, nil, c)
220}
221
222// ProfilerTakePreciseCoverage Collect coverage data for the current isolate, and resets execution counters. Precise code
223// coverage needs to have started.
224type ProfilerTakePreciseCoverage struct{}
225
226// ProtoReq name.
227func (m ProfilerTakePreciseCoverage) ProtoReq() string { return "Profiler.takePreciseCoverage" }
228
229// Call the request.
230func (m ProfilerTakePreciseCoverage) Call(c Client) (*ProfilerTakePreciseCoverageResult, error) {
231	var res ProfilerTakePreciseCoverageResult
232	return &res, call(m.ProtoReq(), m, &res, c)
233}
234
235// ProfilerTakePreciseCoverageResult ...
236type ProfilerTakePreciseCoverageResult struct {
237	// Result Coverage data for the current isolate.
238	Result []*ProfilerScriptCoverage `json:"result"`
239
240	// Timestamp Monotonically increasing time (in seconds) when the coverage update was taken in the backend.
241	Timestamp float64 `json:"timestamp"`
242}
243
244// ProfilerConsoleProfileFinished ...
245type ProfilerConsoleProfileFinished struct {
246	// ID ...
247	ID string `json:"id"`
248
249	// Location of console.profileEnd().
250	Location *DebuggerLocation `json:"location"`
251
252	// Profile ...
253	Profile *ProfilerProfile `json:"profile"`
254
255	// Title (optional) Profile title passed as an argument to console.profile().
256	Title string `json:"title,omitempty"`
257}
258
259// ProtoEvent name.
260func (evt ProfilerConsoleProfileFinished) ProtoEvent() string {
261	return "Profiler.consoleProfileFinished"
262}
263
264// ProfilerConsoleProfileStarted Sent when new profile recording is started using console.profile() call.
265type ProfilerConsoleProfileStarted struct {
266	// ID ...
267	ID string `json:"id"`
268
269	// Location of console.profile().
270	Location *DebuggerLocation `json:"location"`
271
272	// Title (optional) Profile title passed as an argument to console.profile().
273	Title string `json:"title,omitempty"`
274}
275
276// ProtoEvent name.
277func (evt ProfilerConsoleProfileStarted) ProtoEvent() string {
278	return "Profiler.consoleProfileStarted"
279}
280
281// ProfilerPreciseCoverageDeltaUpdate (experimental) Reports coverage delta since the last poll (either from an event like this, or from
282// `takePreciseCoverage` for the current isolate. May only be sent if precise code
283// coverage has been started. This event can be trigged by the embedder to, for example,
284// trigger collection of coverage data immediately at a certain point in time.
285type ProfilerPreciseCoverageDeltaUpdate struct {
286	// Timestamp Monotonically increasing time (in seconds) when the coverage update was taken in the backend.
287	Timestamp float64 `json:"timestamp"`
288
289	// Occasion Identifier for distinguishing coverage events.
290	Occasion string `json:"occasion"`
291
292	// Result Coverage data for the current isolate.
293	Result []*ProfilerScriptCoverage `json:"result"`
294}
295
296// ProtoEvent name.
297func (evt ProfilerPreciseCoverageDeltaUpdate) ProtoEvent() string {
298	return "Profiler.preciseCoverageDeltaUpdate"
299}