-
Notifications
You must be signed in to change notification settings - Fork 0
/
cpuprofilenode.go
executable file
·91 lines (69 loc) · 2.37 KB
/
cpuprofilenode.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
89
90
91
// Copyright 2021 the v8go contributors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
package v8go
type CPUProfileNode struct {
// The id of the current node, unique within the tree.
nodeID int
// The id of the script where the function originates.
scriptID int
// The resource name for script from where the function originates.
scriptResourceName string
// The function name (empty string for anonymous functions.)
functionName string
// The number of the line where the function originates.
lineNumber int
// The number of the column where the function originates.
columnNumber int
// The count of samples where the function was currently executing.
hitCount int
// The bailout reason for the function if the optimization was disabled for it.
bailoutReason string
// The children node of this node.
children []*CPUProfileNode
// The parent node of this node.
parent *CPUProfileNode
}
// Returns node id.
func (c *CPUProfileNode) GetNodeID() int {
return c.nodeID
}
// Returns id for script from where the function originates.
func (c *CPUProfileNode) GetScriptID() int {
return c.scriptID
}
// Returns function name (empty string for anonymous functions.)
func (c *CPUProfileNode) GetFunctionName() string {
return c.functionName
}
// Returns resource name for script from where the function originates.
func (c *CPUProfileNode) GetScriptResourceName() string {
return c.scriptResourceName
}
// Returns number of the line where the function originates.
func (c *CPUProfileNode) GetLineNumber() int {
return c.lineNumber
}
// Returns number of the column where the function originates.
func (c *CPUProfileNode) GetColumnNumber() int {
return c.columnNumber
}
// Returns count of samples where the function was currently executing.
func (c *CPUProfileNode) GetHitCount() int {
return c.hitCount
}
// Returns the bailout reason for the function if the optimization was disabled for it.
func (c *CPUProfileNode) GetBailoutReason() string {
return c.bailoutReason
}
// Retrieves the ancestor node, or nil if the root.
func (c *CPUProfileNode) GetParent() *CPUProfileNode {
return c.parent
}
func (c *CPUProfileNode) GetChildrenCount() int {
return len(c.children)
}
// Retrieves a child node by index.
func (c *CPUProfileNode) GetChild(index int) *CPUProfileNode {
return c.children[index]
}