perfmonger 0.10.2 → 0.12.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.
Files changed (63) hide show
  1. checksums.yaml +5 -5
  2. data/.gitignore +3 -0
  3. data/.travis.yml +9 -8
  4. data/HOWTO.md +0 -1
  5. data/NEWS +49 -5
  6. data/README.md +77 -27
  7. data/Rakefile +33 -11
  8. data/core/Makefile +22 -31
  9. data/core/build.sh +6 -8
  10. data/core/cmd/perfmonger-player/perfmonger-player.go +247 -0
  11. data/core/{perfmonger-plot-formatter.go → cmd/perfmonger-plot-formatter/perfmonger-plot-formatter.go} +20 -5
  12. data/core/{perfmonger-recorder.go → cmd/perfmonger-recorder/perfmonger-recorder.go} +22 -2
  13. data/core/{perfmonger-summarizer.go → cmd/perfmonger-summarizer/perfmonger-summarizer.go} +22 -15
  14. data/core/cmd/perfmonger-viewer/perfmonger-viewer.go +164 -0
  15. data/core/go.mod +10 -0
  16. data/core/go.sum +17 -0
  17. data/core/subsystem/Makefile +4 -0
  18. data/core/subsystem/perfmonger_linux.go +95 -0
  19. data/core/subsystem/perfmonger_linux_test.go +40 -0
  20. data/core/subsystem/stat.go +70 -0
  21. data/core/subsystem/stat_test.go +9 -0
  22. data/core/subsystem/usage.go +223 -66
  23. data/core/subsystem/usage_test.go +62 -32
  24. data/core/utils.go +2 -2
  25. data/{bin → exe}/perfmonger +0 -0
  26. data/lib/exec/perfmonger-player_darwin_amd64 +0 -0
  27. data/lib/exec/perfmonger-player_linux_amd64 +0 -0
  28. data/lib/exec/perfmonger-plot-formatter_darwin_amd64 +0 -0
  29. data/lib/exec/perfmonger-plot-formatter_linux_amd64 +0 -0
  30. data/lib/exec/perfmonger-recorder_darwin_amd64 +0 -0
  31. data/lib/exec/perfmonger-recorder_linux_amd64 +0 -0
  32. data/lib/exec/perfmonger-summarizer_darwin_amd64 +0 -0
  33. data/lib/exec/perfmonger-summarizer_linux_amd64 +0 -0
  34. data/lib/exec/perfmonger-viewer_darwin_amd64 +0 -0
  35. data/lib/exec/perfmonger-viewer_linux_amd64 +0 -0
  36. data/lib/perfmonger/command/fingerprint.rb +26 -1
  37. data/lib/perfmonger/command/live.rb +19 -0
  38. data/lib/perfmonger/command/play.rb +16 -0
  39. data/lib/perfmonger/command/plot.rb +23 -9
  40. data/lib/perfmonger/command/record.rb +24 -3
  41. data/lib/perfmonger/command/record_option.rb +16 -0
  42. data/lib/perfmonger/command/server.rb +1 -1
  43. data/lib/perfmonger/version.rb +1 -1
  44. data/misc/werker-box/Dockerfile +34 -0
  45. data/misc/werker-box/build-push.sh +7 -0
  46. data/perfmonger.gemspec +2 -1
  47. data/spec/data/busy100.pgr.played +3 -3
  48. data/spec/fingerprint_spec.rb +1 -1
  49. data/spec/live_spec.rb +2 -3
  50. data/spec/perfmonger_spec.rb +1 -1
  51. data/spec/play_spec.rb +1 -1
  52. data/spec/plot_spec.rb +16 -1
  53. data/spec/record_spec.rb +10 -1
  54. data/spec/spec_helper.rb +28 -3
  55. data/spec/stat_spec.rb +2 -2
  56. data/spec/summary_spec.rb +1 -1
  57. data/wercker.yml +29 -16
  58. metadata +34 -14
  59. data/core/perfmonger-player.go +0 -196
  60. data/lib/exec/perfmonger-player_linux_386 +0 -0
  61. data/lib/exec/perfmonger-plot-formatter_linux_386 +0 -0
  62. data/lib/exec/perfmonger-recorder_linux_386 +0 -0
  63. data/lib/exec/perfmonger-summarizer_linux_386 +0 -0
data/core/utils.go CHANGED
@@ -1,4 +1,4 @@
1
- package main
1
+ package core
2
2
 
3
3
  import (
4
4
  "bufio"
@@ -6,7 +6,7 @@ import (
6
6
  "io"
7
7
  )
8
8
 
9
- func newPerfmongerLogReader(source io.Reader) io.Reader {
9
+ func NewPerfmongerLogReader(source io.Reader) io.Reader {
10
10
  var ret io.Reader
11
11
  reader := bufio.NewReader(source)
12
12
 
File without changes
Binary file
@@ -57,6 +57,10 @@ EOS
57
57
  save_proc_info()
58
58
  end
59
59
 
60
+ do_with_message("Saving numactl info") do
61
+ save_numactl_info()
62
+ end
63
+
60
64
  do_with_message("Saving IRQ info") do
61
65
  save_irq_info()
62
66
  end
@@ -109,9 +113,14 @@ EOS
109
113
  save_nvme_info()
110
114
  end
111
115
 
112
-
113
116
  ## Collect vendor specific info
114
117
 
118
+ # https://aws.amazon.com/jp/code/ec2-instance-metadata-query-tool/
119
+ if find_executable("ec2-metadata")
120
+ do_with_message("Saving EC2 metadata info") do
121
+ save_ec2metadata_info()
122
+ end
123
+ end
115
124
 
116
125
  # LSI MegaRAID
117
126
  megacli_bin = "/opt/MegaRAID/MegaCli/MegaCli64"
@@ -241,6 +250,22 @@ EOS
241
250
  end
242
251
  end
243
252
 
253
+ def save_numactl_info()
254
+ numactl_bin = find_executable("numactl")
255
+
256
+ File.open("#{@output_dir}/numactl.log", "w") do |f|
257
+ f.puts(`#{numactl_bin} --hardware`)
258
+ end
259
+ end
260
+
261
+ def save_ec2metadata_info()
262
+ ec2metadata_bin = find_executable("ec2-metadata")
263
+
264
+ File.open("#{@output_dir}/ec2-metadata.log", "w") do |f|
265
+ f.puts(`#{ec2metadata_bin} --all`)
266
+ end
267
+ end
268
+
244
269
  def save_lsblk_info()
245
270
  lsblk_bin = find_executable("lsblk")
246
271
 
@@ -7,10 +7,29 @@ module PerfMonger
7
7
  module Command
8
8
 
9
9
  class LiveOption < RecordOption
10
+ def initialize
11
+ super
12
+
13
+ @color = false
14
+ @parser.on("-c", "--color", "Use colored JSON output") do
15
+ @color = true
16
+ end
17
+
18
+ @pretty
19
+ @parser.on("--pretty", "Use human readable JSON output") do
20
+ @pretty = true
21
+ end
22
+
23
+ end
24
+
10
25
  def make_command
11
26
  cmd = super()
12
27
  @player_bin = ::PerfMonger::Command::CoreFinder.player()
13
28
  cmd += ["-player-bin", @player_bin]
29
+ cmd << "-color" if @color
30
+ cmd << "-pretty" if @pretty
31
+
32
+ cmd
14
33
  end
15
34
  end
16
35
 
@@ -16,6 +16,16 @@ Usage: perfmonger play [options] LOG_FILE
16
16
  Options:
17
17
  EOS
18
18
 
19
+ @color = false
20
+ @parser.on("-c", "--color", "Use colored JSON ouptut") do
21
+ @color = true
22
+ end
23
+
24
+ @pretty = false
25
+ @parser.on("-p", "--pretty", "Use human readable JSON ouptut") do
26
+ @pretty = true
27
+ end
28
+
19
29
  end
20
30
 
21
31
  def parse_args(argv)
@@ -46,6 +56,12 @@ EOS
46
56
  end
47
57
 
48
58
  cmd = [@player_bin]
59
+ if @color
60
+ cmd << "-color"
61
+ end
62
+ if @pretty
63
+ cmd << "-pretty"
64
+ end
49
65
  cmd << @logfile
50
66
 
51
67
  Process.exec(*cmd)
@@ -24,11 +24,13 @@ EOS
24
24
  @output_type = 'pdf'
25
25
  @output_prefix = ''
26
26
  @save_gpfiles = false
27
+ @disk_only = nil
27
28
  @disk_only_regex = nil
28
29
  @disk_plot_read = true
29
30
  @disk_plot_write = true
30
31
  @disk_numkey_threshold = 10
31
32
  @plot_iops_max = nil
33
+ @gnuplot_bin = `which gnuplot`
32
34
  end
33
35
 
34
36
  def parse_args(argv)
@@ -46,6 +48,10 @@ EOS
46
48
  @output_dir = dir
47
49
  end
48
50
 
51
+ @parser.on('--with-gnuplot GNUPLOT_BIN') do |gnuplot_bin|
52
+ @gnuplot_bin = gnuplot_bin
53
+ end
54
+
49
55
  @parser.on('-T', '--output-type TYPE', 'Available: pdf, png') do |typ|
50
56
  unless ['pdf', 'png'].include?(typ)
51
57
  puts("ERROR: non supported image type: #{typ}")
@@ -78,6 +84,7 @@ EOS
78
84
  end
79
85
 
80
86
  @parser.on('--disk-only REGEX', "Select disk devices that matches REGEX") do |regex|
87
+ @disk_only = regex
81
88
  @disk_only_regex = Regexp.compile(regex)
82
89
  end
83
90
 
@@ -117,13 +124,14 @@ EOS
117
124
  end
118
125
 
119
126
  def run(argv)
120
- parse_args(argv)
121
127
  unless system('which gnuplot >/dev/null 2>&1')
122
128
  puts("ERROR: gnuplot not found")
123
129
  puts(@parser.help)
124
130
  exit(false)
125
131
  end
126
132
 
133
+ parse_args(argv)
134
+
127
135
  unless system('gnuplot -e "set terminal" < /dev/null 2>&1 | grep pdfcairo >/dev/null 2>&1')
128
136
  puts("ERROR: pdfcairo is not supported by installed gnuplot")
129
137
  puts("ERROR: PerfMonger requires pdfcairo-supported gnuplot")
@@ -139,7 +147,13 @@ EOS
139
147
  @cpu_dat = File.expand_path("cpu.dat", @tmpdir)
140
148
 
141
149
  meta_json = nil
142
- IO.popen([formatter_bin, "-perfmonger", @data_file, "-cpufile", @cpu_dat, "-diskfile", @disk_dat], "r") do |io|
150
+ cmd = [formatter_bin, "-perfmonger", @data_file, "-cpufile", @cpu_dat,
151
+ "-diskfile", @disk_dat]
152
+ if @disk_only_regex
153
+ cmd << "-disk-only"
154
+ cmd << @disk_only
155
+ end
156
+ IO.popen(cmd, "r") do |io|
143
157
  meta_json = io.read
144
158
  end
145
159
  if $?.exitstatus != 0
@@ -391,10 +405,10 @@ EOS
391
405
  nr_cols = nr_cpu_factors.select do |x|
392
406
  x <= Math.sqrt(nr_cpu)
393
407
  end.max
394
- nr_cols ||= Math.sqrt(nr_cpu).ceil
408
+ nr_cols = 1
395
409
  nr_rows = nr_cpu / nr_cols
396
410
 
397
- plot_height = 8
411
+ plot_height = ([nr_cpu, 8].min) + ([nr_cpu - 8, 0].max) * 0.5
398
412
 
399
413
  if nr_rows == 1
400
414
  plot_height /= 2.0
@@ -424,14 +438,14 @@ EOS
424
438
  end
425
439
 
426
440
  all_gpfile.puts <<EOS
427
- set title 'cpu #{cpu_idx}' offset 0.0,-0.7 font 'Arial,16'
441
+ set title 'cpu #{cpu_idx}' offset -61,-3 font 'Arial,16'
428
442
  unset key
429
443
  set origin #{xpos}, #{ypos}
430
444
  set size #{1.0/nr_cols}, #{(1.0 - legend_height)/nr_rows}
431
- set rmargin 0.5
432
- set lmargin 3.5
433
- set tmargin 1.3
434
- set bmargin 1.3
445
+ set rmargin 2
446
+ set lmargin 12
447
+ set tmargin 0.5
448
+ set bmargin 0.5
435
449
  set xtics offset 0.0,0.5
436
450
  set ytics offset 0.5,0
437
451
  set style fill noborder
@@ -19,7 +19,7 @@ class RecordCommand < BaseCommand
19
19
  def run(argv)
20
20
  @argv, @option = PerfMonger::Command::RecordOption.parse(argv)
21
21
 
22
- session_file = File.expand_path(sprintf("perfmonger-%s-session.pid", Etc.getlogin),
22
+ session_file = File.expand_path(sprintf("perfmonger-%s-session.pid", Etc.getpwuid.name),
23
23
  Dir.tmpdir)
24
24
  begin
25
25
  session_pid = File.read(session_file).to_i
@@ -31,7 +31,8 @@ class RecordCommand < BaseCommand
31
31
  if @option.kill
32
32
  unless session_pid
33
33
  # There is nothing to be killed
34
- return true
34
+ $stderr.puts("[ERROR] No perfmonger record session is running.")
35
+ return false
35
36
  end
36
37
 
37
38
  begin
@@ -44,12 +45,32 @@ class RecordCommand < BaseCommand
44
45
  f.flock(File::LOCK_UN)
45
46
  end
46
47
  end
48
+
49
+ # wait until the process surely exits
50
+ sleeptime = 0.05
51
+ try = 0
52
+ while true
53
+ begin
54
+ Process.kill(:INT, session_pid)
55
+ rescue Errno::ESRCH
56
+ # no such process
57
+ break
58
+ end
59
+ sleep(sleeptime)
60
+ sleeptime *= 2
61
+ try += 1
62
+ if try >= 5
63
+ $stderr.puts("[ERROR] Cannot stop perfmonger record session correctly. PID=#{session_pid}")
64
+ return false
65
+ end
66
+ end
67
+
47
68
  return true
48
69
  end
49
70
 
50
71
  if @option.status
51
72
  unless session_pid
52
- puts "[ERROR] No perfmonger-recorder is running."
73
+ puts "[ERROR] No perfmonger record session is running."
53
74
  return false
54
75
  end
55
76
 
@@ -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
@@ -114,7 +114,7 @@ EOS
114
114
  _, record_option = PerfMonger::Command::RecordOption.parse(@record_cmd_args)
115
115
 
116
116
  # find perfmonger command
117
- perfmonger_bin = File.expand_path('bin/perfmonger', PerfMonger::ROOTDIR)
117
+ perfmonger_bin = File.expand_path('exe/perfmonger', PerfMonger::ROOTDIR)
118
118
  if ! File.executable?(perfmonger_bin)
119
119
  puts("ERROR: perfmonger not found!")
120
120
  exit(false)
@@ -1,3 +1,3 @@
1
1
  module PerfMonger
2
- VERSION = "0.10.2"
2
+ VERSION = "0.12.1"
3
3
  end
@@ -0,0 +1,34 @@
1
+ FROM golang:1.14
2
+
3
+ WORKDIR /app
4
+
5
+ ## install packages
6
+ RUN apt-get update
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
9
+
10
+ ## get source code
11
+ RUN git clone https://github.com/hayamiz/perfmonger .
12
+
13
+ ## install RVM
14
+ RUN gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 7D2BAF1CF37B13E2069D6956105BD0E739499BDB
15
+ RUN curl -O https://raw.githubusercontent.com/rvm/rvm/master/binscripts/rvm-installer
16
+ RUN curl -O https://raw.githubusercontent.com/rvm/rvm/master/binscripts/rvm-installer.asc
17
+ RUN gpg --verify rvm-installer.asc
18
+ RUN bash rvm-installer stable
19
+ RUN ln -sf /bin/bash /bin/sh
20
+
21
+ ## install ruby
22
+ RUN bash -l -c "rvm install 2.4.9"
23
+ RUN bash -l -c "rvm use 2.4.9 && gem install bundler && bundle"
24
+
25
+ RUN bash -l -c "rvm install 2.5.7"
26
+ RUN bash -l -c "rvm use 2.5.7 && gem install bundler && bundle"
27
+
28
+ RUN bash -l -c "rvm install 2.6.5"
29
+ RUN bash -l -c "rvm use 2.6.5 && gem install bundler && bundle"
30
+
31
+ RUN bash -l -c "rvm install 2.7.0"
32
+ RUN bash -l -c "rvm use 2.7.0 && gem install bundler && bundle"
33
+
34
+ CMD true
@@ -0,0 +1,7 @@
1
+ #!/bin/bash
2
+
3
+ set -e
4
+
5
+ docker build -t go-rvm .
6
+ docker tag go-rvm hayamiz/go-rvm:wercker-env-0.11.2
7
+ docker push hayamiz/go-rvm:wercker-env-0.11.2
data/perfmonger.gemspec CHANGED
@@ -26,7 +26,8 @@ Gem::Specification.new do |s|
26
26
  end
27
27
  s.files += Dir.glob("lib/exec/*")
28
28
  s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
29
- s.executables = `git ls-files -- bin/*`.split("\n").map{|f| File.basename(f)}
29
+ s.bindir = "exe"
30
+ s.executables = `git ls-files -- exe/*`.split("\n").map{|f| File.basename(f)}
30
31
 
31
32
  s.post_install_message = <<EOS
32
33
 
@@ -1,3 +1,3 @@
1
- {"time":1425358686.123,"cpu":{"num_core":2,"all":{"usr":100.00,"nice":0.00,"sys":0.67,"idle":99.33,"iowait":0.00,"hardirq":0.00,"softirq":0.00,"steal":0.00,"guest":0.00,"guestnice":0.00},"cores":[{"usr":0.33,"nice":0.00,"sys":0.33,"idle":99.33,"iowait":0.00,"hardirq":0.00,"softirq":0.00,"steal":0.00,"guest":0.00,"guestnice":0.00},{"usr":99.67,"nice":0.00,"sys":0.33,"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":1.67,"rkbyteps":0.00,"wkbyteps":26.66,"rlatency":0.000,"wlatency":0.000,"rsize":0.00,"wsize":32.00,"qlen":0.00},"sda1":{"riops":0.00,"wiops":1.67,"rkbyteps":0.00,"wkbyteps":26.66,"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":3.33,"rkbyteps":0.00,"wkbyteps":53.31,"rlatency":0.000,"wlatency":0.000,"rsize":0.00,"wsize":32.00,"qlen":0.00}},"net":{"devices":["eth0","lo"],"eth0":{"rxkbyteps":0.04,"rxpktps":0.67,"rxerrps":0.00,"rxdropps":0.00,"txkbyteps":0.24,"txpktps":0.67,"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.04,"rxpktps":0.67,"rxerrps":0.00,"rxdropps":0.00,"txkbyteps":0.24,"txpktps":0.67,"txerrps":0.00,"txdropps":0.00}}}
2
- {"time":1425358689.123,"cpu":{"num_core":2,"all":{"usr":100.50,"nice":0.00,"sys":0.33,"idle":99.17,"iowait":0.00,"hardirq":0.00,"softirq":0.00,"steal":0.00,"guest":0.00,"guestnice":0.00},"cores":[{"usr":0.33,"nice":0.00,"sys":0.33,"idle":99.33,"iowait":0.00,"hardirq":0.00,"softirq":0.00,"steal":0.00,"guest":0.00,"guestnice":0.00},{"usr":100.00,"nice":0.00,"sys":0.00,"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.00,"rkbyteps":0.00,"wkbyteps":0.00,"rlatency":0.000,"wlatency":0.000,"rsize":0.00,"wsize":0.00,"qlen":0.00},"sda1":{"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},"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":0.00,"rkbyteps":0.00,"wkbyteps":0.00,"rlatency":0.000,"wlatency":0.000,"rsize":0.00,"wsize":0.00,"qlen":0.00}},"net":{"devices":["eth0","lo"],"eth0":{"rxkbyteps":0.00,"rxpktps":0.00,"rxerrps":0.00,"rxdropps":0.00,"txkbyteps":0.00,"txpktps":0.00,"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.00,"rxpktps":0.00,"rxerrps":0.00,"rxdropps":0.00,"txkbyteps":0.00,"txpktps":0.00,"txerrps":0.00,"txdropps":0.00}}}
3
- {"time":1425358690.645,"cpu":{"num_core":2,"all":{"usr":100.65,"nice":0.00,"sys":0.00,"idle":99.35,"iowait":0.00,"hardirq":0.00,"softirq":0.00,"steal":0.00,"guest":0.00,"guestnice":0.00},"cores":[{"usr":0.65,"nice":0.00,"sys":0.65,"idle":98.70,"iowait":0.00,"hardirq":0.00,"softirq":0.00,"steal":0.00,"guest":0.00,"guestnice":0.00},{"usr":100.00,"nice":0.00,"sys":0.00,"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.00,"rkbyteps":0.00,"wkbyteps":0.00,"rlatency":0.000,"wlatency":0.000,"rsize":0.00,"wsize":0.00,"qlen":0.00},"sda1":{"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},"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":0.00,"rkbyteps":0.00,"wkbyteps":0.00,"rlatency":0.000,"wlatency":0.000,"rsize":0.00,"wsize":0.00,"qlen":0.00}},"net":{"devices":["eth0","lo"],"eth0":{"rxkbyteps":0.00,"rxpktps":0.00,"rxerrps":0.00,"rxdropps":0.00,"txkbyteps":0.00,"txpktps":0.00,"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.00,"rxpktps":0.00,"rxerrps":0.00,"rxdropps":0.00,"txkbyteps":0.00,"txpktps":0.00,"txerrps":0.00,"txdropps":0.00}}}
1
+ {"time":1425358686.123,"elapsed_time":3.001,"cpu":{"num_core":2,"all":{"usr":100.00,"nice":0.00,"sys":0.67,"idle":99.33,"iowait":0.00,"hardirq":0.00,"softirq":0.00,"steal":0.00,"guest":0.00,"guestnice":0.00},"cores":[{"usr":0.33,"nice":0.00,"sys":0.33,"idle":99.33,"iowait":0.00,"hardirq":0.00,"softirq":0.00,"steal":0.00,"guest":0.00,"guestnice":0.00},{"usr":99.67,"nice":0.00,"sys":0.33,"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":1.67,"rkbyteps":0.00,"wkbyteps":26.66,"rlatency":0.000,"wlatency":0.000,"rsize":0.00,"wsize":32.00,"qlen":0.00},"sda1":{"riops":0.00,"wiops":1.67,"rkbyteps":0.00,"wkbyteps":26.66,"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":3.33,"rkbyteps":0.00,"wkbyteps":53.31,"rlatency":0.000,"wlatency":0.000,"rsize":0.00,"wsize":32.00,"qlen":0.00}},"net":{"devices":["eth0","lo"],"eth0":{"rxkbyteps":0.04,"rxpktps":0.67,"rxerrps":0.00,"rxdropps":0.00,"txkbyteps":0.24,"txpktps":0.67,"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.04,"rxpktps":0.67,"rxerrps":0.00,"rxdropps":0.00,"txkbyteps":0.24,"txpktps":0.67,"txerrps":0.00,"txdropps":0.00}}}
2
+ {"time":1425358689.123,"elapsed_time":6.001,"cpu":{"num_core":2,"all":{"usr":100.50,"nice":0.00,"sys":0.33,"idle":99.17,"iowait":0.00,"hardirq":0.00,"softirq":0.00,"steal":0.00,"guest":0.00,"guestnice":0.00},"cores":[{"usr":0.33,"nice":0.00,"sys":0.33,"idle":99.33,"iowait":0.00,"hardirq":0.00,"softirq":0.00,"steal":0.00,"guest":0.00,"guestnice":0.00},{"usr":100.00,"nice":0.00,"sys":0.00,"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.00,"rkbyteps":0.00,"wkbyteps":0.00,"rlatency":0.000,"wlatency":0.000,"rsize":0.00,"wsize":0.00,"qlen":0.00},"sda1":{"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},"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":0.00,"rkbyteps":0.00,"wkbyteps":0.00,"rlatency":0.000,"wlatency":0.000,"rsize":0.00,"wsize":0.00,"qlen":0.00}},"net":{"devices":["eth0","lo"],"eth0":{"rxkbyteps":0.00,"rxpktps":0.00,"rxerrps":0.00,"rxdropps":0.00,"txkbyteps":0.00,"txpktps":0.00,"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.00,"rxpktps":0.00,"rxerrps":0.00,"rxdropps":0.00,"txkbyteps":0.00,"txpktps":0.00,"txerrps":0.00,"txdropps":0.00}}}
3
+ {"time":1425358690.645,"elapsed_time":7.524,"cpu":{"num_core":2,"all":{"usr":100.65,"nice":0.00,"sys":0.00,"idle":99.35,"iowait":0.00,"hardirq":0.00,"softirq":0.00,"steal":0.00,"guest":0.00,"guestnice":0.00},"cores":[{"usr":0.65,"nice":0.00,"sys":0.65,"idle":98.70,"iowait":0.00,"hardirq":0.00,"softirq":0.00,"steal":0.00,"guest":0.00,"guestnice":0.00},{"usr":100.00,"nice":0.00,"sys":0.00,"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.00,"rkbyteps":0.00,"wkbyteps":0.00,"rlatency":0.000,"wlatency":0.000,"rsize":0.00,"wsize":0.00,"qlen":0.00},"sda1":{"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},"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":0.00,"rkbyteps":0.00,"wkbyteps":0.00,"rlatency":0.000,"wlatency":0.000,"rsize":0.00,"wsize":0.00,"qlen":0.00}},"net":{"devices":["eth0","lo"],"eth0":{"rxkbyteps":0.00,"rxpktps":0.00,"rxerrps":0.00,"rxdropps":0.00,"txkbyteps":0.00,"txpktps":0.00,"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.00,"rxpktps":0.00,"rxerrps":0.00,"rxdropps":0.00,"txkbyteps":0.00,"txpktps":0.00,"txerrps":0.00,"txdropps":0.00}}}
@@ -1,7 +1,7 @@
1
1
  require 'spec_helper'
2
2
  require 'tmpdir'
3
3
 
4
- describe '[fingerprint] subcommand' do
4
+ RSpec.describe '[fingerprint] subcommand' do
5
5
  before(:each) do
6
6
  @old_pwd = Dir.pwd
7
7
  @tmpdir = Dir.mktmpdir
data/spec/live_spec.rb CHANGED
@@ -1,6 +1,6 @@
1
1
  require 'spec_helper'
2
2
 
3
- describe '[live] subcommand' do
3
+ RSpec.describe '[live] subcommand' do
4
4
  before(:each) do
5
5
  skip_if_proc_is_not_available
6
6
  end
@@ -9,7 +9,6 @@ describe '[live] subcommand' do
9
9
  cmd = "#{perfmonger_bin} live --timeout 3"
10
10
  run(cmd, 5)
11
11
  expect(last_command_started).to be_successfully_executed
12
- expect(last_command_started.stdout.lines.to_a.size).to eq 3
13
12
 
14
13
  run(cmd)
15
14
  last_command_started.stdout.each_line do |line|
@@ -21,6 +20,6 @@ describe '[live] subcommand' do
21
20
  expect(json.keys.sort).to eq %w{time cpu disk net}.sort
22
21
  end
23
22
 
24
- expect("perfmonger.pgr").to be_an_existing_file
23
+ expect("perfmonger.pgr.gz").to be_an_existing_file
25
24
  end
26
25
  end