perfmonger 0.9.0 → 0.10.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -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}}}
@@ -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
@@ -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("io.gp").to be_an_existing_file
37
- expect("io.dat").to be_an_existing_file
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
- expect("allcpu.dat").to be_an_existing_file
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
@@ -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.9.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: 2016-12-12 00:00:00.000000000 Z
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