herokubench 0.0.7 → 0.0.8

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 CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- Y2I3MWIyOTY5ZjYwMTNiYTk0MjJmOTBhNGFmM2ZiYTRiMWRhZjcxZg==
4
+ Y2M1MzM3ZTcwZTE3NDViYmJhNmYwYmI0ZmViNGU4OWYyY2Y3NjA0Yg==
5
5
  data.tar.gz: !binary |-
6
- OWNiY2M4NWU2MmRlZDMzM2VjYWY3ZjE4NDE3MjgxNzhiMDk2ODhlNg==
6
+ NDVjOGUzNDdlNGFkZjIxOTc1ZDMwMzQ0NzEwN2Q4MjIyZjNiN2JmMA==
7
7
  !binary "U0hBNTEy":
8
8
  metadata.gz: !binary |-
9
- NzRiNTIwNTdhYjM3YWFhYmY4MjA0M2Y3MWFmNzkxYzkyODlkN2FkN2M3M2Y4
10
- ZTIyZTY5YTBjZTNlY2Y1NWVhZDBhMDllY2M1MGI2MWRjMGY1MmMyMjk4YzBh
11
- NjliZjU0NmVhNDg1NDhkODNiZDcyZmU5Njk0NzA2ZDFkOWNkNDA=
9
+ ZmQ0NTk5Y2U4YmY4YjRjZGEzYTYwMTFhMjFmOTZhZmMzNDBlNWZkYTM2MWU2
10
+ ZmYyYTRiZDk0NTljNGM4ZTMzOTU3YTJmNjdmYTc2MWVkNTJlNGU3YzBjZmM4
11
+ YzQ2NGQ5ZTUwYjYwMDFhMDhhMTk1ZWU3NTMxY2E2ZGFkOGExODY=
12
12
  data.tar.gz: !binary |-
13
- NTJmNDc4NDU2Y2YxMjJiNGExMTAwNWRiNmIxYjExMjI1YWViM2UzZDM4NTk0
14
- ZWI1ZjIzMGU2NzkxNGM2NTAyOWFmZTUxNmQ5ZjYzNmNlN2M5OTg3ZjIyOTQ5
15
- NjhkYzhlZTVkMTZlYTY3Mzc5YzI0NjYxYzM5ODI1YWMxNWYzNzc=
13
+ NzVjOTE1NmYzZWE5NDJhZGFjNTJlMDI1ZWQ1MTlkODUzNGZlMzc5MzZhNWU4
14
+ NGYwNTYwNGQ4NjIxM2E4NjJjYjJhNGI3ZmUwZmM0MjNmYzE0MDNlYmRjYTkz
15
+ NjI5YzkxOTBmNDFkNGY5Y2RkMzFjNWEyM2VhMmI5NmFiYmM4MTY=
data/bin/{hb → hbench} RENAMED
@@ -6,5 +6,4 @@ require "tmpdir"
6
6
  require "uri"
7
7
  require "herokubench/cli"
8
8
 
9
-
10
9
  HerokuBench::CLI.start
@@ -28,8 +28,12 @@ class HerokuBench::CLI < Thor
28
28
  :generic_result=> /^([\w\s]+):\s*([\d|\.]+)/,
29
29
  :response_time_cdf=>/(\d+%)\s+(\d+)/
30
30
  }
31
- @@summable_fields = ["Complete requests","Failed requests", "Write errors"]
32
- @@medianable_fields = ["Connect", "Processing", "Waiting", "Total"]
31
+ @@summable_fields = ["Complete requests","Failed requests", "Write errors", "Requests per second",
32
+ "Total Transferred", "HTML transferred", "Concurrency Level"
33
+ ]
34
+ @@medianable_fields = ["Connect", "Processing", "Waiting", "Total", "Time per request",
35
+ ]
36
+ @@maxable_fields = ["50%", "66%", "75%", "80%", "90%", "95%", "98%", "99%","100%"]
33
37
 
34
38
  class_options["verbose"] = false if class_options["verbose"].nil?
35
39
  Heroku.user_agent = "heroku-gem/#{Heroku::VERSION} (#{RUBY_PLATFORM}) ruby/#{RUBY_VERSION}"
@@ -95,31 +99,29 @@ class HerokuBench::CLI < Thor
95
99
 
96
100
  ab_command = "ab #{args.join(' ')}"
97
101
 
98
- p_bar = ProgressBar.new('Setup', dynos)
102
+ p_bar = ProgressBar.create(:title=>'Benching',:total=>dynos, :smoothing => 0.6)
99
103
 
100
104
  until n == dynos do
101
- p_bar.inc
102
105
  outputs.push Tempfile.new("hbench_out_#{n}")
103
106
  pid = spawn( "ruby #{bencher_path} \"#{ab_command} \" --app #{config[:app]}", :out=>outputs[n].path)
104
107
  pid_map[pid] = n
105
108
  n += 1
106
109
  end
107
110
 
108
- p_bar.finish
109
- p_bar = ProgressBar.new('Benching', dynos)
110
111
 
111
112
  until n == 0 do
112
113
  output = outputs[pid_map[Process.wait]]
113
- last_output = output.read if n ==1
114
- p_bar.inc
114
+ if n ==1
115
+ last_output = output.read if n ==1
116
+ output.rewind
117
+ end
118
+ p_bar.increment
115
119
  results.push get_result_hash output
116
120
  output.unlink
117
121
  n -= 1
118
122
  end
119
123
 
120
- p_bar.finish
121
-
122
- if results.last.length ==3
124
+ if results.last.length == 3
123
125
  summarize results
124
126
  else
125
127
  error last_output
@@ -147,13 +149,14 @@ class HerokuBench::CLI < Thor
147
149
  result.each do |type, hash|
148
150
  summary[type] = {} if summary[type].nil?
149
151
  hash.each do |k,v|
150
- puts k if v.nil?
151
152
  summary[type][k] = [0.0] * v.length if summary[type][k].nil?
152
153
  v.each_index do |i|
153
154
  if not @@summable_fields.index(k).nil?
154
155
  summary[type][k][i] += v[i]
155
156
  elsif not @@medianable_fields.index(k).nil?
156
157
  summary[type][k][i] += v[i] / results.length.to_f
158
+ elsif not @@maxable_fields.index(k).nil?
159
+ summary[type][k][i] = [v[i], summary[type][k][i]].max
157
160
  else
158
161
  summary[type][k][i] = v[i]
159
162
  end
@@ -162,18 +165,18 @@ class HerokuBench::CLI < Thor
162
165
  end
163
166
  end
164
167
 
165
- say "\tCumulative results"
168
+ say "\tCumulative results, summed across dynos"
166
169
  say ""
167
170
  summary[:generic_result].each{|k,v| say format(k+":",v, 25)}
168
171
 
169
172
  say ""
170
- say "\t Connection Times (ms)"
173
+ say "\t Connection Times (ms), median across dynos"
171
174
  say format("",["min", "mean", "[+/-sd]" ,"median","max"],15)
172
175
  summary[:connection_times].each{|k,v| say format(k+":",v, 15)}
173
176
 
174
177
  say ""
175
178
  say "\t Percentage of the requests served within a certain time (ms)"
176
- say "\t averaged across dynos"
179
+ say "\t across dynos"
177
180
  summary[:response_time_cdf].each{|k,v| say format(k+"",v, 15)}
178
181
  end
179
182
 
@@ -1,5 +1,5 @@
1
1
  module HerokuBench
2
2
 
3
- VERSION = "0.0.7"
3
+ VERSION = "0.0.8"
4
4
 
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: herokubench
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.7
4
+ version: 0.0.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Cory Dolphin
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-06-25 00:00:00.000000000 Z
11
+ date: 2013-07-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: heroku
@@ -65,11 +65,11 @@ description: ! " Make it rain on the cloud.\n\n herokubench, or hb for
65
65
  ab.\n\n Confused? Checkout `hb help`\n"
66
66
  email: wcdolphin@gmail.com
67
67
  executables:
68
- - hb
68
+ - hbench
69
69
  extensions: []
70
70
  extra_rdoc_files: []
71
71
  files:
72
- - bin/hb
72
+ - bin/hbench
73
73
  - lib/herokubench/bencher.rb
74
74
  - lib/herokubench/cli.rb
75
75
  - lib/herokubench/version.rb