perfmonger 0.9.0 → 0.10.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/NEWS +29 -2
- data/core/Makefile +26 -25
- data/core/build.sh +20 -13
- data/core/perfmonger-player.go +34 -2
- data/core/perfmonger-plot-formatter.go +2 -4
- data/core/perfmonger-recorder.go +69 -39
- data/core/perfmonger-summarizer.go +17 -1
- data/core/subsystem/perfmonger_linux.go +108 -2
- data/core/subsystem/stat.go +30 -6
- data/core/subsystem/usage.go +76 -0
- data/core/subsystem/usage_test.go +34 -22
- data/core/utils.go +31 -0
- data/lib/perfmonger/command/fingerprint.rb +107 -23
- data/lib/perfmonger/command/plot.rb +18 -7
- data/lib/perfmonger/command/record.rb +17 -6
- data/lib/perfmonger/command/record_option.rb +25 -0
- data/lib/perfmonger/version.rb +1 -1
- data/spec/data/busy100.pgr.gz +0 -0
- data/spec/data/busy100.pgr.played +3 -0
- data/spec/data/busy100.pgr.plot-formatted.cpu.dat +21 -0
- data/spec/data/busy100.pgr.plot-formatted.disk.dat +32 -0
- data/spec/data/busy100.pgr.summary +55 -0
- data/spec/data/busy100.pgr.summary.json +1 -0
- data/spec/play_spec.rb +16 -0
- data/spec/plot_spec.rb +41 -7
- data/spec/summary_spec.rb +30 -0
- metadata +9 -2
@@ -0,0 +1 @@
|
|
1
|
+
{"exectime":7.524,"cpu":{"num_core":2,"all":{"usr":100.33,"nice":0.00,"sys":0.40,"idle":99.27,"iowait":0.00,"hardirq":0.00,"softirq":0.00,"steal":0.00,"guest":0.00,"guestnice":0.00},"cores":[{"usr":0.40,"nice":0.00,"sys":0.40,"idle":99.20,"iowait":0.00,"hardirq":0.00,"softirq":0.00,"steal":0.00,"guest":0.00,"guestnice":0.00},{"usr":99.87,"nice":0.00,"sys":0.13,"idle":0.00,"iowait":0.00,"hardirq":0.00,"softirq":0.00,"steal":0.00,"guest":0.00,"guestnice":0.00}]},"disk":{"devices":["sda","sda1","sda2"],"sda":{"riops":0.00,"wiops":0.66,"rkbyteps":0.00,"wkbyteps":10.63,"rlatency":0.000,"wlatency":0.000,"rsize":0.00,"wsize":32.00,"qlen":0.00},"sda1":{"riops":0.00,"wiops":0.66,"rkbyteps":0.00,"wkbyteps":10.63,"rlatency":0.000,"wlatency":0.000,"rsize":0.00,"wsize":32.00,"qlen":0.00},"sda2":{"riops":0.00,"wiops":0.00,"rkbyteps":0.00,"wkbyteps":0.00,"rlatency":0.000,"wlatency":0.000,"rsize":0.00,"wsize":0.00,"qlen":0.00},"total":{"riops":0.00,"wiops":1.33,"rkbyteps":0.00,"wkbyteps":21.27,"rlatency":0.000,"wlatency":0.000,"rsize":0.00,"wsize":32.00,"qlen":0.00}},"net":{"devices":["eth0","lo"],"eth0":{"rxkbyteps":0.02,"rxpktps":0.27,"rxerrps":0.00,"rxdropps":0.00,"txkbyteps":0.10,"txpktps":0.27,"txerrps":0.00,"txdropps":0.00},"lo":{"rxkbyteps":0.00,"rxpktps":0.00,"rxerrps":0.00,"rxdropps":0.00,"txkbyteps":0.00,"txpktps":0.00,"txerrps":0.00,"txdropps":0.00},"total":{"rxkbyteps":0.02,"rxpktps":0.27,"rxerrps":0.00,"rxdropps":0.00,"txkbyteps":0.10,"txpktps":0.27,"txerrps":0.00,"txdropps":0.00}}}
|
data/spec/play_spec.rb
CHANGED
@@ -19,4 +19,20 @@ describe '[play] subcommand' do
|
|
19
19
|
expect(json.keys.sort).to eq %w{time cpu disk net}.sort
|
20
20
|
end
|
21
21
|
end
|
22
|
+
|
23
|
+
it "should play plain pgr file" do
|
24
|
+
busy100 = data_file "busy100.pgr"
|
25
|
+
cmd = "#{perfmonger_bin} play #{busy100}"
|
26
|
+
run(cmd)
|
27
|
+
expect(last_command_started).to be_successfully_executed
|
28
|
+
expect(last_command_started.stdout).to eq File.read(data_file "busy100.pgr.played")
|
29
|
+
end
|
30
|
+
|
31
|
+
it "should play plain gzipped file" do
|
32
|
+
busy100 = data_file "busy100.pgr.gz"
|
33
|
+
cmd = "#{perfmonger_bin} play #{busy100}"
|
34
|
+
run(cmd)
|
35
|
+
expect(last_command_started).to be_successfully_executed
|
36
|
+
expect(last_command_started.stdout).to eq File.read(data_file "busy100.pgr.played")
|
37
|
+
end
|
22
38
|
end
|
data/spec/plot_spec.rb
CHANGED
@@ -3,6 +3,14 @@ require 'spec_helper'
|
|
3
3
|
# TODO: examples for options
|
4
4
|
|
5
5
|
describe '[plot] subcommand' do
|
6
|
+
let(:busy100_disk_dat) {
|
7
|
+
File.read(data_file "busy100.pgr.plot-formatted.disk.dat")
|
8
|
+
}
|
9
|
+
let(:busy100_cpu_dat) {
|
10
|
+
File.read(data_file "busy100.pgr.plot-formatted.cpu.dat")
|
11
|
+
}
|
12
|
+
|
13
|
+
|
6
14
|
before(:each) do
|
7
15
|
if ! system("type gnuplot >/dev/null 2>&1")
|
8
16
|
skip "gnuplot is not available"
|
@@ -15,8 +23,8 @@ describe '[plot] subcommand' do
|
|
15
23
|
cmd = "#{perfmonger_bin} plot #{busy100}"
|
16
24
|
run(cmd, 30)
|
17
25
|
expect(last_command_started).to be_successfully_executed
|
18
|
-
expect("iops.pdf").to be_an_existing_file
|
19
|
-
expect("transfer.pdf").to be_an_existing_file
|
26
|
+
expect("disk-iops.pdf").to be_an_existing_file
|
27
|
+
expect("disk-transfer.pdf").to be_an_existing_file
|
20
28
|
expect("cpu.pdf").to be_an_existing_file
|
21
29
|
expect("allcpu.pdf").to be_an_existing_file
|
22
30
|
end
|
@@ -28,16 +36,42 @@ describe '[plot] subcommand' do
|
|
28
36
|
run(cmd, 30)
|
29
37
|
expect(last_command_started).to be_successfully_executed
|
30
38
|
|
31
|
-
expect("iops.pdf").to be_an_existing_file
|
32
|
-
expect("transfer.pdf").to be_an_existing_file
|
39
|
+
expect("disk-iops.pdf").to be_an_existing_file
|
40
|
+
expect("disk-transfer.pdf").to be_an_existing_file
|
33
41
|
expect("cpu.pdf").to be_an_existing_file
|
34
42
|
expect("allcpu.pdf").to be_an_existing_file
|
35
43
|
|
36
|
-
expect("
|
37
|
-
expect("
|
44
|
+
expect("disk.gp").to be_an_existing_file
|
45
|
+
expect("disk.dat").to be_an_existing_file
|
38
46
|
expect("cpu.gp").to be_an_existing_file
|
39
47
|
expect("cpu.dat").to be_an_existing_file
|
40
48
|
expect("allcpu.gp").to be_an_existing_file
|
41
|
-
|
49
|
+
|
50
|
+
# cpu.dat content check
|
51
|
+
expect("disk.dat").to have_file_content busy100_disk_dat
|
52
|
+
expect("cpu.dat").to have_file_content busy100_cpu_dat
|
53
|
+
end
|
54
|
+
|
55
|
+
it 'should work with gzipped perfmonger logfile' do
|
56
|
+
busy100 = data_file "busy100.pgr.gz"
|
57
|
+
|
58
|
+
cmd = "#{perfmonger_bin} plot --save #{busy100}"
|
59
|
+
run(cmd, 30)
|
60
|
+
expect(last_command_started).to be_successfully_executed
|
61
|
+
|
62
|
+
expect("disk-iops.pdf").to be_an_existing_file
|
63
|
+
expect("disk-transfer.pdf").to be_an_existing_file
|
64
|
+
expect("cpu.pdf").to be_an_existing_file
|
65
|
+
expect("allcpu.pdf").to be_an_existing_file
|
66
|
+
|
67
|
+
expect("disk.gp").to be_an_existing_file
|
68
|
+
expect("disk.dat").to be_an_existing_file
|
69
|
+
expect("cpu.gp").to be_an_existing_file
|
70
|
+
expect("cpu.dat").to be_an_existing_file
|
71
|
+
expect("allcpu.gp").to be_an_existing_file
|
72
|
+
|
73
|
+
# cpu.dat content check
|
74
|
+
expect("disk.dat").to have_file_content busy100_disk_dat
|
75
|
+
expect("cpu.dat").to have_file_content busy100_cpu_dat
|
42
76
|
end
|
43
77
|
end
|
data/spec/summary_spec.rb
CHANGED
@@ -2,6 +2,17 @@
|
|
2
2
|
require 'spec_helper'
|
3
3
|
|
4
4
|
describe '[summary] subcommand' do
|
5
|
+
let(:busy100_summary) do
|
6
|
+
content = File.read(data_file "busy100.pgr.summary")
|
7
|
+
|
8
|
+
# strip file path from content
|
9
|
+
content.gsub(/^== performance summary of .*$/, "")
|
10
|
+
end
|
11
|
+
|
12
|
+
let(:busy100_summary_json) do
|
13
|
+
File.read(data_file "busy100.pgr.summary.json")
|
14
|
+
end
|
15
|
+
|
5
16
|
it 'should print valid output' do
|
6
17
|
busy100 = data_file "busy100.pgr"
|
7
18
|
cmd = "#{perfmonger_bin} summary #{busy100}"
|
@@ -48,4 +59,23 @@ describe '[summary] subcommand' do
|
|
48
59
|
|
49
60
|
expect(json.keys.sort).to eq %w{cpu disk net exectime}.sort
|
50
61
|
end
|
62
|
+
|
63
|
+
it 'should work with gzipped input' do
|
64
|
+
busy100 = data_file "busy100.pgr.gz"
|
65
|
+
cmd = "#{perfmonger_bin} summary #{busy100}"
|
66
|
+
run(cmd)
|
67
|
+
expect(last_command_started).to be_successfully_executed
|
68
|
+
output = last_command_started.stdout
|
69
|
+
|
70
|
+
# strip file path from output
|
71
|
+
output.gsub!(/^== performance summary of .*$/, "")
|
72
|
+
expect(output).to eq busy100_summary
|
73
|
+
|
74
|
+
|
75
|
+
cmd = "#{perfmonger_bin} summary --json #{busy100}"
|
76
|
+
run(cmd)
|
77
|
+
expect(last_command_started).to be_successfully_executed
|
78
|
+
output = last_command_started.stdout
|
79
|
+
expect(output).to eq busy100_summary_json
|
80
|
+
end
|
51
81
|
end
|
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.10.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Yuto HAYAMIZU
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2017-09-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -115,6 +115,7 @@ files:
|
|
115
115
|
- core/subsystem/stat_test.go
|
116
116
|
- core/subsystem/usage.go
|
117
117
|
- core/subsystem/usage_test.go
|
118
|
+
- core/utils.go
|
118
119
|
- data/NOTICE
|
119
120
|
- data/Twitter_Bootstrap_LICENSE.txt
|
120
121
|
- data/assets/css/bootstrap-responsive.css
|
@@ -164,6 +165,12 @@ files:
|
|
164
165
|
- misc/sample-read-iops.png
|
165
166
|
- perfmonger.gemspec
|
166
167
|
- spec/data/busy100.pgr
|
168
|
+
- spec/data/busy100.pgr.gz
|
169
|
+
- spec/data/busy100.pgr.played
|
170
|
+
- spec/data/busy100.pgr.plot-formatted.cpu.dat
|
171
|
+
- spec/data/busy100.pgr.plot-formatted.disk.dat
|
172
|
+
- spec/data/busy100.pgr.summary
|
173
|
+
- spec/data/busy100.pgr.summary.json
|
167
174
|
- spec/fingerprint_spec.rb
|
168
175
|
- spec/live_spec.rb
|
169
176
|
- spec/perfmonger_spec.rb
|