/
types.go
88 lines (76 loc) · 4.04 KB
/
types.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
// Code generated by cdpgen. DO NOT EDIT.
package profiler
import (
"github.com/mafredri/cdp/protocol/runtime"
)
// ProfileNode Profile node. Holds callsite information, execution statistics
// and child nodes.
type ProfileNode struct {
ID int `json:"id"` // Unique id of the node.
CallFrame runtime.CallFrame `json:"callFrame"` // Function location.
HitCount *int `json:"hitCount,omitempty"` // Number of samples where this node was on top of the call stack.
Children []int `json:"children,omitempty"` // Child node ids.
DeoptReason *string `json:"deoptReason,omitempty"` // The reason of being not optimized. The function may be deoptimized or marked as don't optimize.
PositionTicks []PositionTickInfo `json:"positionTicks,omitempty"` // An array of source position ticks.
}
// Profile Profile.
type Profile struct {
Nodes []ProfileNode `json:"nodes"` // The list of profile nodes. First item is the root node.
StartTime float64 `json:"startTime"` // Profiling start timestamp in microseconds.
EndTime float64 `json:"endTime"` // Profiling end timestamp in microseconds.
Samples []int `json:"samples,omitempty"` // Ids of samples top nodes.
TimeDeltas []int `json:"timeDeltas,omitempty"` // Time intervals between adjacent samples in microseconds. The first delta is relative to the profile startTime.
}
// PositionTickInfo Specifies a number of samples attributed to a certain
// source position.
type PositionTickInfo struct {
Line int `json:"line"` // Source line number (1-based).
Ticks int `json:"ticks"` // Number of samples attributed to the source line.
}
// CoverageRange Coverage data for a source range.
type CoverageRange struct {
StartOffset int `json:"startOffset"` // JavaScript script source offset for the range start.
EndOffset int `json:"endOffset"` // JavaScript script source offset for the range end.
Count int `json:"count"` // Collected execution count of the source range.
}
// FunctionCoverage Coverage data for a JavaScript function.
type FunctionCoverage struct {
FunctionName string `json:"functionName"` // JavaScript function name.
Ranges []CoverageRange `json:"ranges"` // Source ranges inside the function with coverage data.
IsBlockCoverage bool `json:"isBlockCoverage"` // Whether coverage data for this function has block granularity.
}
// ScriptCoverage Coverage data for a JavaScript script.
type ScriptCoverage struct {
ScriptID runtime.ScriptID `json:"scriptId"` // JavaScript script id.
URL string `json:"url"` // JavaScript script name or url.
Functions []FunctionCoverage `json:"functions"` // Functions contained in the script that has coverage data.
}
// TypeObject Describes a type collected during runtime.
//
// Note: This type is experimental.
type TypeObject struct {
Name string `json:"name"` // Name of a type collected with type profiling.
}
// TypeProfileEntry Source offset and types for a parameter or return value.
//
// Note: This type is experimental.
type TypeProfileEntry struct {
Offset int `json:"offset"` // Source offset of the parameter or end of function for return values.
Types []TypeObject `json:"types"` // The types for this parameter or return value.
}
// ScriptTypeProfile Type profile data collected during runtime for a
// JavaScript script.
//
// Note: This type is experimental.
type ScriptTypeProfile struct {
ScriptID runtime.ScriptID `json:"scriptId"` // JavaScript script id.
URL string `json:"url"` // JavaScript script name or url.
Entries []TypeProfileEntry `json:"entries"` // Type profile entries for parameters and return values of the functions in the script.
}
// CounterInfo Collected counter information.
//
// Note: This type is experimental.
type CounterInfo struct {
Name string `json:"name"` // Counter name.
Value int `json:"value"` // Counter value.
}