perfmonger 0.8.2 → 0.9.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -39,7 +39,7 @@ EOS
39
39
  end
40
40
  end
41
41
 
42
- @parser.on('--disk-only REGEX', "Select disk devices that matches REGEX") do |regex|
42
+ @parser.on('--disk-only REGEX', "Select disk devices that matches REGEX (Ex. 'sd[b-d]')") do |regex|
43
43
  @disk_only_regex = regex
44
44
  end
45
45
  end
@@ -1,3 +1,3 @@
1
1
  module PerfMonger
2
- VERSION = "0.8.2"
2
+ VERSION = "0.9.0"
3
3
  end
@@ -1,4 +1,3 @@
1
- #compdef perfmonger
2
1
 
3
2
  _perfmonger-record() {
4
3
  local curcontext=$curcontext state line ret=1
@@ -6,15 +5,16 @@ _perfmonger-record() {
6
5
 
7
6
  # TODO: match -d,--device multiple times
8
7
  _arguments -w -C -S \
9
- '(-D --all-devices)'{-d,--device}'[device name to be monitored]: :__perfmonger_devices' \
10
- '(-d --device)'{-D,--all-devices}'[monitor all devices]' \
8
+ '--background[run in background mode]' \
9
+ '--status[show running perfmonger recording session]' \
10
+ '--kill[kill running perfmonger recording session]' \
11
+ {-d,--device}'[device name to be monitored]: :__perfmonger_devices' \
11
12
  '(-i --interval)'{-i,--interval}'[measurement interval]: interval in sec' \
12
- {-l,--logfile}'[log file name]:_files' \
13
+ {-l,--logfile}'[log file name]: :_files' \
13
14
  {-B,--no-interval-backoff}'[prevent interval backoff]' \
14
15
  {-s,--start-delay}'[wait specified time before starting measurement]: wait time in sec' \
15
16
  {-t,--timeout}'[length of measurement time]: timeout in sec' \
16
- {-C,--cpu}'[report CPU usage]' \
17
- {-S,--context-switch}'[report context switches per sec]' \
17
+ '--no-cpu[Do not monitor CPU usage]' \
18
18
  {-v,--verbose}'[verbose]' \
19
19
  {-h,--help}'[show help]' \
20
20
  && return
@@ -26,6 +26,16 @@ _perfmonger-stat() {
26
26
  return ret
27
27
  }
28
28
 
29
+ _perfmonger-play() {
30
+ local curcontext=$curcontext state line ret=1
31
+ declare -A opt_args
32
+
33
+ _arguments -w -C -S \
34
+ '*:: :_files' \
35
+ {-h,--help}'[show help]' \
36
+ && return
37
+ }
38
+
29
39
  _perfmonger-summary() {
30
40
  local curcontext=$curcontext state line ret=1
31
41
  declare -A opt_args
@@ -33,9 +43,9 @@ _perfmonger-summary() {
33
43
  # TODO: accept only 1 file
34
44
  _arguments -w -C -S \
35
45
  '--json[output summary in JSON format]' \
46
+ '--disk-only[select disk devices that matches regexp]: regular expression for target devices' \
36
47
  {-p,--pager}'[use pager to see summary output]: pager program' \
37
48
  {-h,--help}'[show help]' \
38
- {-h,--help}'[show help]' \
39
49
  '*:: :_files' \
40
50
  && return
41
51
  }
@@ -51,6 +61,10 @@ _perfmonger-plot() {
51
61
  {-T,--output-type}'[output image type]:output type:(pdf png)' \
52
62
  {-p,--prefix}'[output file name prefix]:prefix' \
53
63
  {-s,--save}'[save gnuplot script and data files]' \
64
+ '--disk-only[select disk devices that matches regexp]: regular expression for target devices' \
65
+ '--disk-read-only[plot only read performance for disks]' \
66
+ '--disk-write-only[plot only write performance for disks]' \
67
+ '--disk-read-write[plot read and write performance for disks]' \
54
68
  {-h,--help}'[show help]' \
55
69
  '*:: :_files' \
56
70
  && return
@@ -117,7 +131,9 @@ _perfmonger() {
117
131
 
118
132
  _perfmonger_commands() {
119
133
  _values 'command' \
120
- 'record[record system performance]' \
134
+ 'record[record system performance into a log file]' \
135
+ 'play[play a recorded performance log in JSON]' \
136
+ 'live[iostat and mpstat equivalent speaking JSON]' \
121
137
  'stat[run a command and record system performance during execution]' \
122
138
  'plot[plot system performance graphs from a perfmonger log file]' \
123
139
  'fingerprint[gather all possible system config information]' \
data/perfmonger.gemspec CHANGED
@@ -19,7 +19,6 @@ Gem::Specification.new do |s|
19
19
  s.add_development_dependency "rake"
20
20
  s.add_development_dependency "rspec"
21
21
  s.add_development_dependency "rake-compiler"
22
- s.add_development_dependency "guard-rspec"
23
22
  s.add_development_dependency "aruba"
24
23
 
25
24
  s.files = `git ls-files`.split("\n").select do |file|
@@ -15,21 +15,21 @@ describe '[fingerprint] subcommand' do
15
15
 
16
16
  it 'should create output tgz successfully' do
17
17
  run("#{perfmonger_bin} fingerprint output.tgz", 20)
18
- assert_success(true)
19
- check_file_presence("output.tgz")
18
+ expect(last_command_started).to be_successfully_executed
19
+ expect("output.tgz").to be_an_existing_file
20
20
  end
21
21
 
22
22
  it 'should create output tgz successfully with alias invocation' do
23
23
  run("#{perfmonger_bin} fp output.tgz", 20)
24
- assert_success(true)
25
- check_file_presence("output.tgz")
24
+ expect(last_command_started).to be_successfully_executed
25
+ expect("output.tgz").to be_an_existing_file
26
26
  end
27
27
 
28
28
  it "should create output tgz successfully with content" do
29
29
  run("#{perfmonger_bin} fingerprint output.tgz", 20)
30
- assert_success(true)
30
+ expect(last_command_started).to be_successfully_executed
31
31
  run("tar xf output.tgz")
32
- assert_success(true)
33
- check_directory_presence(["output"], true)
32
+ expect(last_command_started).to be_successfully_executed
33
+ expect("output").to be_an_existing_directory
34
34
  end
35
35
  end
data/spec/live_spec.rb CHANGED
@@ -8,10 +8,11 @@ describe '[live] subcommand' do
8
8
  it 'should print JSON records for 3 seconds and exit successfully.' do
9
9
  cmd = "#{perfmonger_bin} live --timeout 3"
10
10
  run(cmd, 5)
11
- assert_success(true)
12
- expect(stdout_from(cmd).lines.to_a.size).to eq 3
11
+ expect(last_command_started).to be_successfully_executed
12
+ expect(last_command_started.stdout.lines.to_a.size).to eq 3
13
13
 
14
- stdout_from(cmd).each_line do |line|
14
+ run(cmd)
15
+ last_command_started.stdout.each_line do |line|
15
16
  expect do
16
17
  JSON.parse(line)
17
18
  end.not_to raise_error
@@ -20,6 +21,6 @@ describe '[live] subcommand' do
20
21
  expect(json.keys.sort).to eq %w{time cpu disk net}.sort
21
22
  end
22
23
 
23
- check_file_presence("perfmonger.pgr")
24
+ expect("perfmonger.pgr").to be_an_existing_file
24
25
  end
25
26
  end
@@ -9,29 +9,29 @@ describe "perfmonger command" do
9
9
  it 'should print help and exit with failure when no arguments given' do
10
10
  cmd = "#{perfmonger_bin}"
11
11
  run(cmd)
12
- assert_success(false)
13
- expect(stdout_from(cmd)).to match(/^Usage: perfmonger/)
12
+ expect(last_command_started).not_to be_successfully_executed
13
+ expect(last_command_started.stdout).to match(/^Usage: perfmonger/)
14
14
  end
15
15
 
16
16
  it 'should print help and exit with success when --help is given' do
17
17
  ["-h", "--help"].each do |arg|
18
18
  cmd = "#{perfmonger_bin} #{arg}"
19
19
  run(cmd)
20
- assert_success(true)
21
- expect(stdout_from(cmd)).to match(/^Usage: perfmonger/)
20
+ expect(last_command_started).to be_successfully_executed
21
+ expect(last_command_started.stdout).to match(/^Usage: perfmonger/)
22
22
  end
23
23
  end
24
24
 
25
25
  it 'should print version number if --version given' do
26
26
  cmd = "#{perfmonger_bin} --version"
27
27
  run(cmd)
28
- assert_success(true)
29
- expect(stdout_from(cmd)).to include(PerfMonger::VERSION)
28
+ expect(last_command_started).to be_successfully_executed
29
+ expect(last_command_started.stdout).to include(PerfMonger::VERSION)
30
30
  end
31
31
 
32
32
  it 'fails if unknown subcommand given' do
33
33
  cmd = "#{perfmonger_bin} piyo"
34
34
  run(cmd)
35
- assert_success(false)
35
+ expect(last_command_started).not_to be_successfully_executed
36
36
  end
37
37
  end
data/spec/play_spec.rb CHANGED
@@ -6,10 +6,11 @@ describe '[play] subcommand' do
6
6
  busy100 = data_file "busy100.pgr"
7
7
  cmd = "#{perfmonger_bin} play #{busy100}"
8
8
  run(cmd)
9
- assert_success(true)
10
- expect(stdout_from(cmd).lines.to_a.size).to eq 3
9
+ expect(last_command_started).to be_successfully_executed
10
+ expect(last_command_started.stdout.lines.to_a.size).to eq 3
11
11
 
12
- stdout_from(cmd).each_line do |line|
12
+ run(cmd)
13
+ last_command_started.stdout.each_line do |line|
13
14
  expect do
14
15
  JSON.parse(line)
15
16
  end.not_to raise_error
data/spec/plot_spec.rb CHANGED
@@ -14,11 +14,11 @@ describe '[plot] subcommand' do
14
14
 
15
15
  cmd = "#{perfmonger_bin} plot #{busy100}"
16
16
  run(cmd, 30)
17
- assert_success(true)
18
- check_file_presence("iops.pdf")
19
- check_file_presence("transfer.pdf")
20
- check_file_presence("cpu.pdf")
21
- check_file_presence("allcpu.pdf")
17
+ 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
20
+ expect("cpu.pdf").to be_an_existing_file
21
+ expect("allcpu.pdf").to be_an_existing_file
22
22
  end
23
23
 
24
24
  it 'should create PDFs, data and gnuplot files when --save is given' do
@@ -26,17 +26,18 @@ describe '[plot] subcommand' do
26
26
 
27
27
  cmd = "#{perfmonger_bin} plot --save #{busy100}"
28
28
  run(cmd, 30)
29
- assert_success(true)
30
- check_file_presence("iops.pdf")
31
- check_file_presence("transfer.pdf")
32
- check_file_presence("cpu.pdf")
33
- check_file_presence("allcpu.pdf")
34
-
35
- check_file_presence("io.gp")
36
- check_file_presence("io.dat")
37
- check_file_presence("cpu.gp")
38
- check_file_presence("cpu.dat")
39
- check_file_presence("allcpu.gp")
40
- check_file_presence("allcpu.dat")
29
+ expect(last_command_started).to be_successfully_executed
30
+
31
+ expect("iops.pdf").to be_an_existing_file
32
+ expect("transfer.pdf").to be_an_existing_file
33
+ expect("cpu.pdf").to be_an_existing_file
34
+ expect("allcpu.pdf").to be_an_existing_file
35
+
36
+ expect("io.gp").to be_an_existing_file
37
+ expect("io.dat").to be_an_existing_file
38
+ expect("cpu.gp").to be_an_existing_file
39
+ expect("cpu.dat").to be_an_existing_file
40
+ expect("allcpu.gp").to be_an_existing_file
41
+ expect("allcpu.dat").to be_an_existing_file
41
42
  end
42
43
  end
data/spec/record_spec.rb CHANGED
@@ -8,8 +8,8 @@ describe '[record] subcommand' do
8
8
  it 'should create a valid logfile with no output to stdout' do
9
9
  cmd = "#{perfmonger_bin} record --timeout 1"
10
10
  run(cmd)
11
- assert_success(true)
12
- check_file_presence("perfmonger.pgr") # default file name
13
- expect(stdout_from(cmd)).to be_empty
11
+ expect(last_command_started).to be_successfully_executed
12
+ expect("perfmonger.pgr").to be_an_existing_file # default file name
13
+ expect(last_command_started.stdout).to be_empty
14
14
  end
15
15
  end
data/spec/stat_spec.rb CHANGED
@@ -9,7 +9,7 @@ describe '[stat] subcommand' do
9
9
  it 'should print "Execution time: XXX.XXX"' do
10
10
  cmd = "#{perfmonger_bin} stat -- sleep 1"
11
11
  run(cmd)
12
- assert_success(true)
13
- check_file_presence("perfmonger.pgr")
12
+ expect(last_command_started).to be_successfully_executed
13
+ expect("perfmonger.pgr").to be_an_existing_file
14
14
  end
15
15
  end
data/spec/summary_spec.rb CHANGED
@@ -6,8 +6,8 @@ describe '[summary] subcommand' do
6
6
  busy100 = data_file "busy100.pgr"
7
7
  cmd = "#{perfmonger_bin} summary #{busy100}"
8
8
  run(cmd)
9
- assert_success(true)
10
- output = stdout_from(cmd)
9
+ expect(last_command_started).to be_successfully_executed
10
+ output = last_command_started.stdout
11
11
 
12
12
  # measurement duration
13
13
  expect(output).to match(/^Duration: (\d+\.\d+) sec$/)
@@ -37,8 +37,8 @@ describe '[summary] subcommand' do
37
37
  busy100 = data_file "busy100.pgr"
38
38
  cmd = "#{perfmonger_bin} summary --json #{busy100}"
39
39
  run(cmd)
40
- assert_success(true)
41
- output = stdout_from(cmd)
40
+ expect(last_command_started).to be_successfully_executed
41
+ output = last_command_started.stdout
42
42
 
43
43
  expect do
44
44
  JSON.parse(output)
@@ -5,7 +5,6 @@ RSpec.configure do |config|
5
5
  config.include Aruba::Api
6
6
 
7
7
  config.before(:each) do
8
- restore_env
9
- clean_current_dir
8
+ setup_aruba
10
9
  end
11
10
  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.8.2
4
+ version: 0.9.0
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-11-22 00:00:00.000000000 Z
11
+ date: 2016-12-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -66,20 +66,6 @@ dependencies:
66
66
  - - ">="
67
67
  - !ruby/object:Gem::Version
68
68
  version: '0'
69
- - !ruby/object:Gem::Dependency
70
- name: guard-rspec
71
- requirement: !ruby/object:Gem::Requirement
72
- requirements:
73
- - - ">="
74
- - !ruby/object:Gem::Version
75
- version: '0'
76
- type: :development
77
- prerelease: false
78
- version_requirements: !ruby/object:Gem::Requirement
79
- requirements:
80
- - - ">="
81
- - !ruby/object:Gem::Version
82
- version: '0'
83
69
  - !ruby/object:Gem::Dependency
84
70
  name: aruba
85
71
  requirement: !ruby/object:Gem::Requirement
@@ -117,6 +103,7 @@ files:
117
103
  - core/Makefile
118
104
  - core/build.sh
119
105
  - core/perfmonger-player.go
106
+ - core/perfmonger-plot-formatter.go
120
107
  - core/perfmonger-recorder.go
121
108
  - core/perfmonger-summarizer.go
122
109
  - core/subsystem/Makefile
@@ -144,6 +131,9 @@ files:
144
131
  - lib/exec/perfmonger-player_darwin_amd64
145
132
  - lib/exec/perfmonger-player_linux_386
146
133
  - lib/exec/perfmonger-player_linux_amd64
134
+ - lib/exec/perfmonger-plot-formatter_darwin_amd64
135
+ - lib/exec/perfmonger-plot-formatter_linux_386
136
+ - lib/exec/perfmonger-plot-formatter_linux_amd64
147
137
  - lib/exec/perfmonger-recorder_darwin_amd64
148
138
  - lib/exec/perfmonger-recorder_linux_386
149
139
  - lib/exec/perfmonger-recorder_linux_amd64
@@ -155,6 +145,7 @@ files:
155
145
  - lib/perfmonger/command/base_command.rb
156
146
  - lib/perfmonger/command/core.rb
157
147
  - lib/perfmonger/command/fingerprint.rb
148
+ - lib/perfmonger/command/init-shell.rb
158
149
  - lib/perfmonger/command/live.rb
159
150
  - lib/perfmonger/command/play.rb
160
151
  - lib/perfmonger/command/plot.rb
@@ -166,8 +157,8 @@ files:
166
157
  - lib/perfmonger/command/summary.rb
167
158
  - lib/perfmonger/config.rb
168
159
  - lib/perfmonger/version.rb
169
- - misc/_perfmonger
170
- - misc/perfmonger-completion.bash
160
+ - misc/perfmonger.bash
161
+ - misc/perfmonger.zsh
171
162
  - misc/release-howto.txt
172
163
  - misc/sample-cpu.png
173
164
  - misc/sample-read-iops.png