forked from chromedp/chromedp
/
types.go
52 lines (44 loc) · 2.83 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
package profiler
import "github.com/knq/chromedp/cdp/runtime"
// AUTOGENERATED. DO NOT EDIT.
// ProfileNode profile node. Holds callsite information, execution statistics
// and child nodes.
type ProfileNode struct {
ID int64 `json:"id,omitempty"` // Unique id of the node.
CallFrame *runtime.CallFrame `json:"callFrame,omitempty"` // Function location.
HitCount int64 `json:"hitCount,omitempty"` // Number of samples where this node was on top of the call stack.
Children []int64 `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,omitempty"` // The list of profile nodes. First item is the root node.
StartTime float64 `json:"startTime,omitempty"` // Profiling start timestamp in microseconds.
EndTime float64 `json:"endTime,omitempty"` // Profiling end timestamp in microseconds.
Samples []int64 `json:"samples,omitempty"` // Ids of samples top nodes.
TimeDeltas []int64 `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 int64 `json:"line,omitempty"` // Source line number (1-based).
Ticks int64 `json:"ticks,omitempty"` // Number of samples attributed to the source line.
}
// CoverageRange coverage data for a source range.
type CoverageRange struct {
StartOffset int64 `json:"startOffset,omitempty"` // JavaScript script source offset for the range start.
EndOffset int64 `json:"endOffset,omitempty"` // JavaScript script source offset for the range end.
Count int64 `json:"count,omitempty"` // Collected execution count of the source range.
}
// FunctionCoverage coverage data for a JavaScript function.
type FunctionCoverage struct {
FunctionName string `json:"functionName,omitempty"` // JavaScript function name.
Ranges []*CoverageRange `json:"ranges,omitempty"` // Source ranges inside the function with coverage data.
}
// ScriptCoverage coverage data for a JavaScript script.
type ScriptCoverage struct {
ScriptID runtime.ScriptID `json:"scriptId,omitempty"` // JavaScript script id.
URL string `json:"url,omitempty"` // JavaScript script name or url.
Functions []*FunctionCoverage `json:"functions,omitempty"` // Functions contained in the script that has coverage data.
}