This repository has been archived by the owner on Jul 19, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 71
/
model.go
91 lines (87 loc) · 1.8 KB
/
model.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
package testhelper
import (
"time"
"github.com/google/pprof/profile"
)
var (
FooMapping = &profile.Mapping{
ID: 1,
Start: uint64(1),
Limit: uint64(2),
Offset: uint64(3),
File: "foobar.so",
BuildID: "v1",
HasFunctions: true,
HasFilenames: true,
HasLineNumbers: true,
HasInlineFrames: false,
}
FooFunction = &profile.Function{
ID: 1,
Name: "foo",
SystemName: "sfoo",
Filename: "foo.go",
StartLine: 1,
}
FooLocation = &profile.Location{
ID: 1,
Address: 1,
IsFolded: false,
Mapping: FooMapping,
Line: []profile.Line{
{
Function: FooFunction,
Line: 100,
},
},
}
BarFunction = &profile.Function{
ID: 2,
Name: "bar",
SystemName: "sbar",
Filename: "bar.go",
StartLine: 1,
}
BarLocation = &profile.Location{
ID: 2,
Address: 2,
IsFolded: true,
Mapping: FooMapping,
Line: []profile.Line{
{
Function: BarFunction,
Line: 200,
},
},
}
FooBarProfile = &profile.Profile{
SampleType: []*profile.ValueType{
{Type: "cpu", Unit: "nanoseconds"},
},
DefaultSampleType: "cpu",
Sample: []*profile.Sample{
{
Value: []int64{1},
Location: []*profile.Location{FooLocation, BarLocation},
},
{
Value: []int64{2},
Location: []*profile.Location{FooLocation},
},
{
Value: []int64{3},
Location: []*profile.Location{BarLocation},
},
},
TimeNanos: 1,
DurationNanos: int64(15 * time.Nanosecond),
Mapping: []*profile.Mapping{FooMapping},
Location: []*profile.Location{FooLocation, BarLocation},
Function: []*profile.Function{FooFunction, BarFunction},
PeriodType: &profile.ValueType{
Type: "cpu",
Unit: "nanoseconds",
},
Period: 10000000,
}
)