5
5
package v8go
6
6
7
7
type CPUProfileNode struct {
8
+ // The id of the current node, unique within the tree.
9
+ nodeId int
10
+
11
+ // The id of the script where the function originates.
12
+ scriptId int
13
+
8
14
// The resource name for script from where the function originates.
9
15
scriptResourceName string
10
16
@@ -17,13 +23,29 @@ type CPUProfileNode struct {
17
23
// The number of the column where the function originates.
18
24
columnNumber int
19
25
26
+ // The count of samples where the function was currently executing.
27
+ hitCount int
28
+
29
+ // The bailout reason for the function if the optimization was disabled for it.
30
+ bailoutReason string
31
+
20
32
// The children node of this node.
21
33
children []* CPUProfileNode
22
34
23
35
// The parent node of this node.
24
36
parent * CPUProfileNode
25
37
}
26
38
39
+ // Returns node id.
40
+ func (c * CPUProfileNode ) GetNodeId () int {
41
+ return c .nodeId
42
+ }
43
+
44
+ // Returns id for script from where the function originates.
45
+ func (c * CPUProfileNode ) GetScriptId () int {
46
+ return c .scriptId
47
+ }
48
+
27
49
// Returns function name (empty string for anonymous functions.)
28
50
func (c * CPUProfileNode ) GetFunctionName () string {
29
51
return c .functionName
@@ -44,6 +66,16 @@ func (c *CPUProfileNode) GetColumnNumber() int {
44
66
return c .columnNumber
45
67
}
46
68
69
+ // Returns count of samples where the function was currently executing.
70
+ func (c * CPUProfileNode ) GetHitCount () int {
71
+ return c .hitCount
72
+ }
73
+
74
+ // Returns the bailout reason for the function if the optimization was disabled for it.
75
+ func (c * CPUProfileNode ) GetBailoutReason () string {
76
+ return c .bailoutReason
77
+ }
78
+
47
79
// Retrieves the ancestor node, or nil if the root.
48
80
func (c * CPUProfileNode ) GetParent () * CPUProfileNode {
49
81
return c .parent
0 commit comments