perfmonger 0.11.2 → 0.12.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +5 -5
- data/NEWS +19 -1
- data/core/perfmonger-player.go +19 -0
- data/core/perfmonger-recorder.go +6 -0
- data/core/perfmonger-summarizer.go +1 -1
- data/core/subsystem/Makefile +4 -0
- data/core/subsystem/perfmonger_linux.go +95 -0
- data/core/subsystem/perfmonger_linux_test.go +40 -0
- data/core/subsystem/stat.go +70 -0
- data/core/subsystem/stat_test.go +9 -0
- data/core/subsystem/usage.go +80 -0
- data/lib/perfmonger/command/plot.rb +7 -1
- data/lib/perfmonger/command/record_option.rb +16 -0
- data/lib/perfmonger/version.rb +1 -1
- data/misc/werker-box/Dockerfile +10 -9
- data/misc/werker-box/build-push.sh +2 -2
- data/wercker.yml +10 -10
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d54380ef057091f9d6829d3a792c0c4a91789b56077ff7a59b4a1bf063ec883e
|
4
|
+
data.tar.gz: c01127d30de0978a88bf1481357d3e20cde8193dd16e6bde9e0f2030d6423710
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8ae9ded1f5d4c5157902ccfa23a12910866834480f7b82e1464f4c2d5e767cbf2d5752118f1aa666f445d2f61a0e5cfbc7198c3ad9cf098539c0cd96a25b12f3
|
7
|
+
data.tar.gz: 3c507d05cec5b3b28e49367379846009b1848ac75d23227d22a019203190b9adeaf201a25805b3746d518d221a46399580d49899f6205f236980c70b3b73a7e5
|
data/.travis.yml
CHANGED
@@ -4,7 +4,7 @@ install:
|
|
4
4
|
- sudo apt-get install gnuplot
|
5
5
|
- gnuplot -e "set terminal" < /dev/null 2>&1
|
6
6
|
- bundle install
|
7
|
-
- go_version="1.
|
7
|
+
- go_version="1.14.1"
|
8
8
|
- wget http://golang.org/dl/go${go_version}.linux-amd64.tar.gz
|
9
9
|
- sudo tar -C /usr/local -xzf go${go_version}.linux-amd64.tar.gz
|
10
10
|
- export PATH=$PATH:/usr/local/go/bin
|
@@ -12,10 +12,10 @@ install:
|
|
12
12
|
- export PATH="$PATH:$GOPATH/bin"
|
13
13
|
- mkdir -p "$HOME/go/{src,pkg,bin}"
|
14
14
|
rvm:
|
15
|
-
- 2.
|
16
|
-
- 2.
|
17
|
-
- 2.
|
18
|
-
- 2.
|
15
|
+
- 2.4.9
|
16
|
+
- 2.5.7
|
17
|
+
- 2.6.5
|
18
|
+
- 2.7.0
|
19
19
|
script:
|
20
20
|
- rake go_get
|
21
21
|
- rake spec
|
data/NEWS
CHANGED
@@ -1,9 +1,27 @@
|
|
1
|
-
## 20XX-XX-XX: PerfMonger 0.
|
1
|
+
## 20XX-XX-XX: PerfMonger 0.13.0
|
2
|
+
|
3
|
+
## 2021-05-10: PerfMonger 0.12.0
|
4
|
+
* New features
|
5
|
+
* [record] subcommand:
|
6
|
+
* Add memory usage collection
|
7
|
+
|
8
|
+
## 2021-02-10: PerfMonger 0.11.3
|
9
|
+
* Bug fixes
|
10
|
+
* [plot] subcommand:
|
11
|
+
* Fall back to available gnuplot terminal
|
12
|
+
* Changes
|
13
|
+
* [plot] subcommand:
|
14
|
+
* Added --with-gnuplot option for specifying gnuplot binary
|
2
15
|
|
3
16
|
## 2020-03-31: PerfMonger 0.11.2
|
4
17
|
* Bug fixes
|
5
18
|
* [plot] subcommand:
|
6
19
|
* Remove temporary directory correctly
|
20
|
+
* Changes
|
21
|
+
* CI environment
|
22
|
+
* Changed golang version to 1.14
|
23
|
+
* Dropped support of ruby older than 2.4
|
24
|
+
* Added ruby 2.6 and 2.7
|
7
25
|
|
8
26
|
## 2018-05-15: PerfMonger 0.11.1
|
9
27
|
* Bug fixes
|
data/core/perfmonger-player.go
CHANGED
@@ -80,6 +80,19 @@ func showNetStat(printer *projson.JsonPrinter, prev_rec *ss.StatRecord, cur_rec
|
|
80
80
|
return nil
|
81
81
|
}
|
82
82
|
|
83
|
+
func showMemStat(printer *projson.JsonPrinter, cur_rec *ss.StatRecord) error {
|
84
|
+
musage, err := ss.GetMemUsage(cur_rec.Mem)
|
85
|
+
if err != nil {
|
86
|
+
return err
|
87
|
+
}
|
88
|
+
|
89
|
+
printer.PutKey("mem")
|
90
|
+
|
91
|
+
musage.WriteJsonTo(printer)
|
92
|
+
|
93
|
+
return nil
|
94
|
+
}
|
95
|
+
|
83
96
|
func showStat(printer *projson.JsonPrinter, prev_rec *ss.StatRecord, cur_rec *ss.StatRecord) error {
|
84
97
|
printer.Reset()
|
85
98
|
if option.pretty {
|
@@ -119,6 +132,12 @@ func showStat(printer *projson.JsonPrinter, prev_rec *ss.StatRecord, cur_rec *ss
|
|
119
132
|
return err
|
120
133
|
}
|
121
134
|
}
|
135
|
+
if cur_rec.Mem != nil {
|
136
|
+
err := showMemStat(printer, cur_rec)
|
137
|
+
if err != nil {
|
138
|
+
return err
|
139
|
+
}
|
140
|
+
}
|
122
141
|
|
123
142
|
printer.FinishObject()
|
124
143
|
|
data/core/perfmonger-recorder.go
CHANGED
@@ -36,6 +36,7 @@ type RecorderOption struct {
|
|
36
36
|
no_intr bool
|
37
37
|
no_disk bool
|
38
38
|
no_net bool
|
39
|
+
no_mem bool
|
39
40
|
debug bool
|
40
41
|
listDevices bool
|
41
42
|
player_bin string
|
@@ -76,6 +77,8 @@ func parseArgs() {
|
|
76
77
|
false, "Do not record disk usage")
|
77
78
|
flag.BoolVar(&option.no_net, "no-net",
|
78
79
|
false, "Do not record net usage")
|
80
|
+
flag.BoolVar(&option.no_mem, "no-mem",
|
81
|
+
false, "Do not record memory usage")
|
79
82
|
flag.BoolVar(&option.debug, "debug",
|
80
83
|
false, "Enable debug mode")
|
81
84
|
flag.BoolVar(&option.listDevices, "list-devices",
|
@@ -340,6 +343,9 @@ func main() {
|
|
340
343
|
if !option.no_net {
|
341
344
|
ss.ReadNetStat(record)
|
342
345
|
}
|
346
|
+
if !option.no_mem {
|
347
|
+
ss.ReadMemStat(record)
|
348
|
+
}
|
343
349
|
|
344
350
|
err = enc.Encode(record)
|
345
351
|
if err != nil {
|
@@ -128,7 +128,7 @@ func main() {
|
|
128
128
|
option.disk_only_regex)
|
129
129
|
}
|
130
130
|
|
131
|
-
if fst_record.
|
131
|
+
if fst_record.Net != nil && lst_record.Net != nil {
|
132
132
|
net_usage, err = ss.GetNetUsage(
|
133
133
|
fst_record.Time, fst_record.Net,
|
134
134
|
lst_record.Time, lst_record.Net)
|
data/core/subsystem/Makefile
CHANGED
@@ -429,3 +429,98 @@ func ReadNetStat(record *StatRecord) error {
|
|
429
429
|
|
430
430
|
return nil
|
431
431
|
}
|
432
|
+
|
433
|
+
func ReadMemStat(record *StatRecord) error {
|
434
|
+
if record == nil {
|
435
|
+
return errors.New("Valid *StatRecord is required.")
|
436
|
+
}
|
437
|
+
|
438
|
+
mem_stat := NewMemStat()
|
439
|
+
|
440
|
+
f, err := os.Open("/proc/meminfo")
|
441
|
+
if err != nil {
|
442
|
+
return err
|
443
|
+
}
|
444
|
+
defer f.Close()
|
445
|
+
scanner := bufio.NewScanner(f)
|
446
|
+
|
447
|
+
for scanner.Scan() {
|
448
|
+
var key string
|
449
|
+
var val int64
|
450
|
+
line := scanner.Text()
|
451
|
+
|
452
|
+
n, err := fmt.Sscanf(line, "%s %d", &key, &val)
|
453
|
+
|
454
|
+
if err == io.EOF {
|
455
|
+
break
|
456
|
+
} else if err != nil {
|
457
|
+
return err
|
458
|
+
}
|
459
|
+
if n != 2 {
|
460
|
+
continue
|
461
|
+
}
|
462
|
+
|
463
|
+
switch key {
|
464
|
+
case "HugePages_Surp:":
|
465
|
+
mem_stat.HugePages_Surp = val
|
466
|
+
case "HugePages_Rsvd:":
|
467
|
+
mem_stat.HugePages_Rsvd = val
|
468
|
+
case "HugePages_Free:":
|
469
|
+
mem_stat.HugePages_Free = val
|
470
|
+
case "HugePages_Total:":
|
471
|
+
mem_stat.HugePages_Total = val
|
472
|
+
case "AnonHugePages:":
|
473
|
+
mem_stat.AnonHugePages = val
|
474
|
+
case "Committed_AS:":
|
475
|
+
mem_stat.Committed_AS = val
|
476
|
+
case "CommitLimit:":
|
477
|
+
mem_stat.CommitLimit = val
|
478
|
+
case "Bounce:":
|
479
|
+
mem_stat.Bounce = val
|
480
|
+
case "NFS_Unstable:":
|
481
|
+
mem_stat.NFS_Unstable = val
|
482
|
+
case "Shmem:":
|
483
|
+
mem_stat.Shmem = val
|
484
|
+
case "Slab:":
|
485
|
+
mem_stat.Slab = val
|
486
|
+
case "SReclaimable:":
|
487
|
+
mem_stat.SReclaimable = val
|
488
|
+
case "SUnreclaim:":
|
489
|
+
mem_stat.SUnreclaim = val
|
490
|
+
case "KernelStack:":
|
491
|
+
mem_stat.KernelStack = val
|
492
|
+
case "PageTables:":
|
493
|
+
mem_stat.PageTables = val
|
494
|
+
case "Mapped:":
|
495
|
+
mem_stat.Mapped = val
|
496
|
+
case "AnonPages:":
|
497
|
+
mem_stat.AnonPages = val
|
498
|
+
case "Writeback:":
|
499
|
+
mem_stat.Writeback = val
|
500
|
+
case "Dirty:":
|
501
|
+
mem_stat.Dirty = val
|
502
|
+
case "SwapFree:":
|
503
|
+
mem_stat.SwapFree = val
|
504
|
+
case "SwapTotal:":
|
505
|
+
mem_stat.SwapTotal = val
|
506
|
+
case "Inactive:":
|
507
|
+
mem_stat.Inactive = val
|
508
|
+
case "Active:":
|
509
|
+
mem_stat.Active = val
|
510
|
+
case "SwapCached:":
|
511
|
+
mem_stat.SwapCached = val
|
512
|
+
case "Cached:":
|
513
|
+
mem_stat.Cached = val
|
514
|
+
case "Buffers:":
|
515
|
+
mem_stat.Buffers = val
|
516
|
+
case "MemFree:":
|
517
|
+
mem_stat.MemFree = val
|
518
|
+
case "MemTotal:":
|
519
|
+
mem_stat.MemTotal = val
|
520
|
+
}
|
521
|
+
}
|
522
|
+
|
523
|
+
record.Mem = mem_stat
|
524
|
+
|
525
|
+
return nil
|
526
|
+
}
|
@@ -1,6 +1,7 @@
|
|
1
1
|
package subsystem
|
2
2
|
|
3
3
|
import (
|
4
|
+
"log"
|
4
5
|
"os"
|
5
6
|
"testing"
|
6
7
|
)
|
@@ -71,3 +72,42 @@ func TestReadNetStat(t *testing.T) {
|
|
71
72
|
t.Error("Device 'lo' not found.")
|
72
73
|
}
|
73
74
|
}
|
75
|
+
|
76
|
+
func TestReadMemStat(t *testing.T) {
|
77
|
+
var err error
|
78
|
+
var stat_record *StatRecord = nil
|
79
|
+
|
80
|
+
err = ReadMemStat(stat_record)
|
81
|
+
if err == nil {
|
82
|
+
t.Errorf("Error should not be returned with non-nil *StatRecord.")
|
83
|
+
}
|
84
|
+
|
85
|
+
_, err = os.Stat("/proc/meminfo")
|
86
|
+
if err != nil {
|
87
|
+
t.Skip("/proc/meminfo is not present.")
|
88
|
+
}
|
89
|
+
|
90
|
+
stat_record = NewStatRecord()
|
91
|
+
err = ReadMemStat(stat_record)
|
92
|
+
if err != nil {
|
93
|
+
log.Print(err)
|
94
|
+
t.Error("Error should not be returned with valid *StatRecord.")
|
95
|
+
return
|
96
|
+
}
|
97
|
+
if stat_record.Mem == nil {
|
98
|
+
t.Error("stat_record.Mem should not be nil")
|
99
|
+
return
|
100
|
+
}
|
101
|
+
|
102
|
+
if stat_record.Mem.MemTotal == 0 {
|
103
|
+
t.Error("Cannot read MemTotal correctly")
|
104
|
+
return
|
105
|
+
}
|
106
|
+
|
107
|
+
mem := stat_record.Mem
|
108
|
+
|
109
|
+
if (mem.MemFree + mem.Cached + mem.Buffers) > mem.MemTotal {
|
110
|
+
t.Error("Inconsistent meminfo values")
|
111
|
+
return
|
112
|
+
}
|
113
|
+
}
|
data/core/subsystem/stat.go
CHANGED
@@ -102,6 +102,38 @@ type NetStat struct {
|
|
102
102
|
Entries []*NetStatEntry
|
103
103
|
}
|
104
104
|
|
105
|
+
// all values are recorded in KB
|
106
|
+
type MemStat struct {
|
107
|
+
MemTotal int64
|
108
|
+
MemFree int64
|
109
|
+
Buffers int64
|
110
|
+
Cached int64
|
111
|
+
SwapCached int64
|
112
|
+
Active int64
|
113
|
+
Inactive int64
|
114
|
+
SwapTotal int64
|
115
|
+
SwapFree int64
|
116
|
+
Dirty int64
|
117
|
+
Writeback int64
|
118
|
+
AnonPages int64
|
119
|
+
Mapped int64
|
120
|
+
Shmem int64
|
121
|
+
Slab int64
|
122
|
+
SReclaimable int64
|
123
|
+
SUnreclaim int64
|
124
|
+
KernelStack int64
|
125
|
+
PageTables int64
|
126
|
+
NFS_Unstable int64
|
127
|
+
Bounce int64
|
128
|
+
CommitLimit int64
|
129
|
+
Committed_AS int64
|
130
|
+
AnonHugePages int64
|
131
|
+
HugePages_Total int64
|
132
|
+
HugePages_Free int64
|
133
|
+
HugePages_Rsvd int64
|
134
|
+
HugePages_Surp int64
|
135
|
+
}
|
136
|
+
|
105
137
|
type StatRecord struct {
|
106
138
|
Time time.Time
|
107
139
|
Cpu *CpuStat
|
@@ -110,6 +142,7 @@ type StatRecord struct {
|
|
110
142
|
Disk *DiskStat
|
111
143
|
Softirq *SoftIrqStat
|
112
144
|
Net *NetStat
|
145
|
+
Mem *MemStat
|
113
146
|
}
|
114
147
|
|
115
148
|
func (core_stat *CpuCoreStat) Clear() {
|
@@ -219,6 +252,42 @@ func NewNetStat() *NetStat {
|
|
219
252
|
return new(NetStat)
|
220
253
|
}
|
221
254
|
|
255
|
+
func NewMemStat() *MemStat {
|
256
|
+
return new(MemStat)
|
257
|
+
}
|
258
|
+
|
259
|
+
func (entry *MemStat) Clear() {
|
260
|
+
entry.MemTotal = 0
|
261
|
+
entry.MemFree = 0
|
262
|
+
entry.Buffers = 0
|
263
|
+
entry.Cached = 0
|
264
|
+
entry.SwapCached = 0
|
265
|
+
entry.Active = 0
|
266
|
+
entry.Inactive = 0
|
267
|
+
entry.SwapTotal = 0
|
268
|
+
entry.SwapFree = 0
|
269
|
+
entry.Dirty = 0
|
270
|
+
entry.Writeback = 0
|
271
|
+
entry.AnonPages = 0
|
272
|
+
entry.Mapped = 0
|
273
|
+
entry.Shmem = 0
|
274
|
+
entry.Slab = 0
|
275
|
+
entry.SReclaimable = 0
|
276
|
+
entry.NFS_Unstable = 0
|
277
|
+
entry.SUnreclaim = 0
|
278
|
+
entry.KernelStack = 0
|
279
|
+
entry.PageTables = 0
|
280
|
+
entry.NFS_Unstable = 0
|
281
|
+
entry.Bounce = 0
|
282
|
+
entry.CommitLimit = 0
|
283
|
+
entry.Committed_AS = 0
|
284
|
+
entry.AnonHugePages = 0
|
285
|
+
entry.HugePages_Total = 0
|
286
|
+
entry.HugePages_Free = 0
|
287
|
+
entry.HugePages_Rsvd = 0
|
288
|
+
entry.HugePages_Surp = 0
|
289
|
+
}
|
290
|
+
|
222
291
|
func NewStatRecord() *StatRecord {
|
223
292
|
return &StatRecord{
|
224
293
|
time.Now(),
|
@@ -228,6 +297,7 @@ func NewStatRecord() *StatRecord {
|
|
228
297
|
nil,
|
229
298
|
nil,
|
230
299
|
nil,
|
300
|
+
nil,
|
231
301
|
}
|
232
302
|
}
|
233
303
|
|
data/core/subsystem/stat_test.go
CHANGED
@@ -262,6 +262,14 @@ func TestNewNetStat(t *testing.T) {
|
|
262
262
|
}
|
263
263
|
}
|
264
264
|
|
265
|
+
func TestNewMemStat(t *testing.T) {
|
266
|
+
memstat := NewMemStat()
|
267
|
+
|
268
|
+
if memstat == nil {
|
269
|
+
t.Error("failed to create MemStat")
|
270
|
+
}
|
271
|
+
}
|
272
|
+
|
265
273
|
func TestNewStatRecord(t *testing.T) {
|
266
274
|
stat_record := NewStatRecord()
|
267
275
|
|
@@ -278,4 +286,5 @@ func TestNewStatRecord(t *testing.T) {
|
|
278
286
|
checkFieldIsNil("Disk")
|
279
287
|
checkFieldIsNil("Softirq")
|
280
288
|
checkFieldIsNil("Net")
|
289
|
+
checkFieldIsNil("Mem")
|
281
290
|
}
|
data/core/subsystem/usage.go
CHANGED
@@ -85,6 +85,10 @@ type NetUsageEntry struct {
|
|
85
85
|
|
86
86
|
type NetUsage map[string]*NetUsageEntry
|
87
87
|
|
88
|
+
type MemUsage struct {
|
89
|
+
mem *MemStat
|
90
|
+
}
|
91
|
+
|
88
92
|
var UseColor = false
|
89
93
|
|
90
94
|
func SetUseColor(use_color bool) {
|
@@ -562,6 +566,82 @@ func (nusage *NetUsage) WriteJsonTo(printer *projson.JsonPrinter) {
|
|
562
566
|
printer.FinishObject()
|
563
567
|
}
|
564
568
|
|
569
|
+
func GetMemUsage(mem *MemStat) (*MemUsage, error) {
|
570
|
+
if mem == nil {
|
571
|
+
return nil, errors.New("invalid memstat")
|
572
|
+
}
|
573
|
+
|
574
|
+
musage := new(MemUsage)
|
575
|
+
musage.mem = mem
|
576
|
+
|
577
|
+
return musage, nil
|
578
|
+
}
|
579
|
+
|
580
|
+
func (musage *MemUsage) WriteJsonTo(printer *projson.JsonPrinter) {
|
581
|
+
printer.BeginObject()
|
582
|
+
|
583
|
+
printer.PutKey("mem_total")
|
584
|
+
printer.PutInt64(musage.mem.MemTotal)
|
585
|
+
printer.PutKey("mem_used")
|
586
|
+
printer.PutInt64(musage.mem.MemTotal - musage.mem.MemFree - musage.mem.Buffers - musage.mem.Cached - musage.mem.SReclaimable)
|
587
|
+
printer.PutKey("mem_free")
|
588
|
+
printer.PutInt64(musage.mem.MemFree)
|
589
|
+
printer.PutKey("buffers")
|
590
|
+
printer.PutInt64(musage.mem.Buffers)
|
591
|
+
printer.PutKey("cached")
|
592
|
+
printer.PutInt64(musage.mem.Cached)
|
593
|
+
printer.PutKey("swap_cached")
|
594
|
+
printer.PutInt64(musage.mem.SwapCached)
|
595
|
+
printer.PutKey("active")
|
596
|
+
printer.PutInt64(musage.mem.Active)
|
597
|
+
printer.PutKey("inactive")
|
598
|
+
printer.PutInt64(musage.mem.Inactive)
|
599
|
+
printer.PutKey("swap_total")
|
600
|
+
printer.PutInt64(musage.mem.SwapTotal)
|
601
|
+
printer.PutKey("swap_free")
|
602
|
+
printer.PutInt64(musage.mem.SwapFree)
|
603
|
+
printer.PutKey("dirty")
|
604
|
+
printer.PutInt64(musage.mem.Dirty)
|
605
|
+
printer.PutKey("writeback")
|
606
|
+
printer.PutInt64(musage.mem.Writeback)
|
607
|
+
printer.PutKey("anon_pages")
|
608
|
+
printer.PutInt64(musage.mem.AnonPages)
|
609
|
+
printer.PutKey("mapped")
|
610
|
+
printer.PutInt64(musage.mem.Mapped)
|
611
|
+
printer.PutKey("shmem")
|
612
|
+
printer.PutInt64(musage.mem.Shmem)
|
613
|
+
printer.PutKey("slab")
|
614
|
+
printer.PutInt64(musage.mem.Slab)
|
615
|
+
printer.PutKey("s_reclaimable")
|
616
|
+
printer.PutInt64(musage.mem.SReclaimable)
|
617
|
+
printer.PutKey("s_unreclaim")
|
618
|
+
printer.PutInt64(musage.mem.SUnreclaim)
|
619
|
+
printer.PutKey("kernel_stack")
|
620
|
+
printer.PutInt64(musage.mem.KernelStack)
|
621
|
+
printer.PutKey("page_tables")
|
622
|
+
printer.PutInt64(musage.mem.PageTables)
|
623
|
+
printer.PutKey("nfs_unstable")
|
624
|
+
printer.PutInt64(musage.mem.NFS_Unstable)
|
625
|
+
printer.PutKey("bounce")
|
626
|
+
printer.PutInt64(musage.mem.Bounce)
|
627
|
+
printer.PutKey("commit_limit")
|
628
|
+
printer.PutInt64(musage.mem.CommitLimit)
|
629
|
+
printer.PutKey("committed_as")
|
630
|
+
printer.PutInt64(musage.mem.Committed_AS)
|
631
|
+
printer.PutKey("anon_huge_pages")
|
632
|
+
printer.PutInt64(musage.mem.AnonHugePages)
|
633
|
+
printer.PutKey("huge_pages_total")
|
634
|
+
printer.PutInt64(musage.mem.HugePages_Total)
|
635
|
+
printer.PutKey("huge_pages_free")
|
636
|
+
printer.PutInt64(musage.mem.HugePages_Free)
|
637
|
+
printer.PutKey("huge_pages_rsvd")
|
638
|
+
printer.PutInt64(musage.mem.HugePages_Rsvd)
|
639
|
+
printer.PutKey("huge_pages_surp")
|
640
|
+
printer.PutInt64(musage.mem.HugePages_Surp)
|
641
|
+
|
642
|
+
printer.FinishObject()
|
643
|
+
}
|
644
|
+
|
565
645
|
func (entry *NetUsageEntry) WriteJsonTo(printer *projson.JsonPrinter) {
|
566
646
|
printer.BeginObject()
|
567
647
|
|
@@ -30,6 +30,7 @@ EOS
|
|
30
30
|
@disk_plot_write = true
|
31
31
|
@disk_numkey_threshold = 10
|
32
32
|
@plot_iops_max = nil
|
33
|
+
@gnuplot_bin = `which gnuplot`
|
33
34
|
end
|
34
35
|
|
35
36
|
def parse_args(argv)
|
@@ -47,6 +48,10 @@ EOS
|
|
47
48
|
@output_dir = dir
|
48
49
|
end
|
49
50
|
|
51
|
+
@parser.on('--with-gnuplot GNUPLOT_BIN') do |gnuplot_bin|
|
52
|
+
@gnuplot_bin = gnuplot_bin
|
53
|
+
end
|
54
|
+
|
50
55
|
@parser.on('-T', '--output-type TYPE', 'Available: pdf, png') do |typ|
|
51
56
|
unless ['pdf', 'png'].include?(typ)
|
52
57
|
puts("ERROR: non supported image type: #{typ}")
|
@@ -119,13 +124,14 @@ EOS
|
|
119
124
|
end
|
120
125
|
|
121
126
|
def run(argv)
|
122
|
-
parse_args(argv)
|
123
127
|
unless system('which gnuplot >/dev/null 2>&1')
|
124
128
|
puts("ERROR: gnuplot not found")
|
125
129
|
puts(@parser.help)
|
126
130
|
exit(false)
|
127
131
|
end
|
128
132
|
|
133
|
+
parse_args(argv)
|
134
|
+
|
129
135
|
unless system('gnuplot -e "set terminal" < /dev/null 2>&1 | grep pdfcairo >/dev/null 2>&1')
|
130
136
|
puts("ERROR: pdfcairo is not supported by installed gnuplot")
|
131
137
|
puts("ERROR: PerfMonger requires pdfcairo-supported gnuplot")
|
@@ -63,6 +63,12 @@ class RecordOption
|
|
63
63
|
if @no_intr
|
64
64
|
cmd << "-no-intr"
|
65
65
|
end
|
66
|
+
if @no_net
|
67
|
+
cmd << "-no-net"
|
68
|
+
end
|
69
|
+
if @no_mem
|
70
|
+
cmd << "-no-mem"
|
71
|
+
end
|
66
72
|
if @devices.size > 0
|
67
73
|
cmd << "-disks"
|
68
74
|
cmd << @devices.join(",")
|
@@ -98,6 +104,8 @@ class RecordOption
|
|
98
104
|
@no_cpu = false
|
99
105
|
@no_disk = false
|
100
106
|
@no_intr = true
|
107
|
+
@no_net = true
|
108
|
+
@no_mem = false
|
101
109
|
@devices = []
|
102
110
|
@logfile = "perfmonger.pgr"
|
103
111
|
@logfile_set = false
|
@@ -141,6 +149,14 @@ class RecordOption
|
|
141
149
|
@no_cpu = true
|
142
150
|
end
|
143
151
|
|
152
|
+
@parser.on('--no-net', 'Suppress recording network usage') do
|
153
|
+
@no_net = false
|
154
|
+
end
|
155
|
+
|
156
|
+
@parser.on('--no-mem', 'Suppress recording memory usage') do
|
157
|
+
@no_mem = true
|
158
|
+
end
|
159
|
+
|
144
160
|
@parser.on('-l', '--logfile FILE') do |file|
|
145
161
|
@logfile = file
|
146
162
|
@logfile_set = true
|
data/lib/perfmonger/version.rb
CHANGED
data/misc/werker-box/Dockerfile
CHANGED
@@ -1,10 +1,11 @@
|
|
1
|
-
FROM golang:1.
|
1
|
+
FROM golang:1.14
|
2
2
|
|
3
3
|
WORKDIR /app
|
4
4
|
|
5
5
|
## install packages
|
6
6
|
RUN apt-get update
|
7
7
|
RUN apt-get install -y build-essential libncurses-dev libreadline-dev libssl-dev gnuplot git gnupg2
|
8
|
+
RUN apt-get install -y autoconf bison build-essential libssl-dev libyaml-dev libreadline6-dev zlib1g-dev libncurses5-dev libffi-dev libgdbm-dev gawk libsqlite3-dev libtool sqlite3 libgmp-dev # ruby build dep
|
8
9
|
|
9
10
|
## get source code
|
10
11
|
RUN git clone https://github.com/hayamiz/perfmonger .
|
@@ -18,16 +19,16 @@ RUN bash rvm-installer stable
|
|
18
19
|
RUN ln -sf /bin/bash /bin/sh
|
19
20
|
|
20
21
|
## install ruby
|
21
|
-
RUN bash -l -c "rvm install 2.
|
22
|
-
RUN bash -l -c "rvm use 2.
|
22
|
+
RUN bash -l -c "rvm install 2.4.9"
|
23
|
+
RUN bash -l -c "rvm use 2.4.9 && gem install bundler && bundle"
|
23
24
|
|
24
|
-
RUN bash -l -c "rvm install 2.
|
25
|
-
RUN bash -l -c "rvm use 2.
|
25
|
+
RUN bash -l -c "rvm install 2.5.7"
|
26
|
+
RUN bash -l -c "rvm use 2.5.7 && gem install bundler && bundle"
|
26
27
|
|
27
|
-
RUN bash -l -c "rvm install 2.
|
28
|
-
RUN bash -l -c "rvm use 2.
|
28
|
+
RUN bash -l -c "rvm install 2.6.5"
|
29
|
+
RUN bash -l -c "rvm use 2.6.5 && gem install bundler && bundle"
|
29
30
|
|
30
|
-
RUN bash -l -c "rvm install 2.
|
31
|
-
RUN bash -l -c "rvm use 2.
|
31
|
+
RUN bash -l -c "rvm install 2.7.0"
|
32
|
+
RUN bash -l -c "rvm use 2.7.0 && gem install bundler && bundle"
|
32
33
|
|
33
34
|
CMD true
|
data/wercker.yml
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
box: hayamiz/go-rvm:wercker-env
|
1
|
+
box: hayamiz/go-rvm:wercker-env-0.11.2
|
2
2
|
# Build definition
|
3
3
|
build:
|
4
4
|
# The steps that will be executed on build
|
@@ -9,14 +9,14 @@ build:
|
|
9
9
|
name: prepare perfmonger go subsystem
|
10
10
|
code: |
|
11
11
|
source /etc/profile.d/rvm.sh
|
12
|
-
rvm use 2.
|
12
|
+
rvm use 2.4.9
|
13
13
|
rake go_get
|
14
14
|
|
15
15
|
- script:
|
16
|
-
name: switch ruby to 2.
|
16
|
+
name: switch ruby to 2.4.9
|
17
17
|
code: |
|
18
18
|
source /etc/profile.d/rvm.sh
|
19
|
-
rvm use 2.
|
19
|
+
rvm use 2.4.9
|
20
20
|
- bundle-install
|
21
21
|
- script:
|
22
22
|
name: run rspec
|
@@ -25,10 +25,10 @@ build:
|
|
25
25
|
bundle exec rake spec
|
26
26
|
|
27
27
|
- script:
|
28
|
-
name: switch ruby to 2.
|
28
|
+
name: switch ruby to 2.5.7
|
29
29
|
code: |
|
30
30
|
source /etc/profile.d/rvm.sh
|
31
|
-
rvm use 2.
|
31
|
+
rvm use 2.5.7
|
32
32
|
- bundle-install
|
33
33
|
- script:
|
34
34
|
name: run rspec
|
@@ -37,10 +37,10 @@ build:
|
|
37
37
|
bundle exec rake spec
|
38
38
|
|
39
39
|
- script:
|
40
|
-
name: switch ruby to 2.
|
40
|
+
name: switch ruby to 2.6.5
|
41
41
|
code: |
|
42
42
|
source /etc/profile.d/rvm.sh
|
43
|
-
rvm use 2.
|
43
|
+
rvm use 2.6.5
|
44
44
|
- bundle-install
|
45
45
|
- script:
|
46
46
|
name: run rspec
|
@@ -49,10 +49,10 @@ build:
|
|
49
49
|
bundle exec rake spec
|
50
50
|
|
51
51
|
- script:
|
52
|
-
name: switch ruby to 2.
|
52
|
+
name: switch ruby to 2.7.0
|
53
53
|
code: |
|
54
54
|
source /etc/profile.d/rvm.sh
|
55
|
-
rvm use 2.
|
55
|
+
rvm use 2.7.0
|
56
56
|
- bundle-install
|
57
57
|
- script:
|
58
58
|
name: run rspec
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: perfmonger
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.12.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Yuto HAYAMIZU
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-05-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|