bigbench 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (52) hide show
  1. data/README.textile +60 -22
  2. data/Rakefile +7 -0
  3. data/bigbench.gemspec +5 -0
  4. data/dev/net_http.rb +78 -0
  5. data/dev/test.rb +13 -0
  6. data/dev/tracking.rb +49 -0
  7. data/doc/BigBench.html +22 -17
  8. data/doc/BigBench/Benchmark.html +12 -8
  9. data/doc/BigBench/Benchmark/Benchmark.html +17 -27
  10. data/doc/BigBench/Benchmark/Looper.html +340 -0
  11. data/doc/BigBench/Bot.html +4 -2
  12. data/doc/BigBench/Configuration.html +20 -11
  13. data/doc/BigBench/Configuration/Config.html +23 -8
  14. data/doc/BigBench/Configuration/InvalidOptions.html +5 -3
  15. data/doc/BigBench/Executor.html +4 -2
  16. data/doc/BigBench/Executor/InvalidCommand.html +4 -2
  17. data/doc/BigBench/Fragment.html +46 -29
  18. data/doc/BigBench/Fragment/Fragment.html +18 -28
  19. data/doc/BigBench/Output.html +4 -2
  20. data/doc/BigBench/Runner.html +12 -9
  21. data/doc/BigBench/Runner/NoBenchmarksDefined.html +4 -2
  22. data/doc/BigBench/Store.html +4 -2
  23. data/doc/BigBench/Tracker.html +4 -2
  24. data/doc/BigBench/Tracker/Tracker.html +5 -3
  25. data/doc/EventMachineLoop.html +296 -0
  26. data/doc/Float.html +4 -2
  27. data/doc/Gemfile.html +4 -2
  28. data/doc/Helpers.html +4 -2
  29. data/doc/Object.html +87 -2
  30. data/doc/Rakefile.html +10 -3
  31. data/doc/created.rid +36 -31
  32. data/doc/index.html +4 -2
  33. data/doc/js/search_index.js +1 -1
  34. data/doc/lib/bigbench/help/executor_txt.html +4 -2
  35. data/doc/table_of_contents.html +31 -16
  36. data/lib/bigbench.rb +3 -0
  37. data/lib/bigbench/benchmark.rb +11 -21
  38. data/lib/bigbench/benchmark/looper.rb +43 -0
  39. data/lib/bigbench/configuration.rb +17 -10
  40. data/lib/bigbench/fragment.rb +47 -34
  41. data/lib/bigbench/runner.rb +8 -7
  42. data/lib/bigbench/tracker.rb +3 -3
  43. data/lib/bigbench/version.rb +1 -1
  44. data/spec/benchmark_spec.rb +14 -7
  45. data/spec/configure_spec.rb +3 -3
  46. data/spec/fragment_spec.rb +186 -24
  47. data/spec/helpers.rb +2 -4
  48. data/spec/lib/test_web_server.rb +44 -15
  49. data/spec/looper_spec.rb +47 -0
  50. data/spec/tests/local.rb +1 -1
  51. data/spec/webserver_spec.rb +91 -21
  52. metadata +77 -15
@@ -1,63 +1,77 @@
1
1
  h1. BigBench
2
2
 
3
- h2. Installation
3
+ BigBench is a http penetration tool. It allows you to test the performance of any web server with very high loads.
4
+
5
+ h3. Installation
4
6
 
5
7
  bc.. gem install bigbench
6
8
 
7
- h2. Requirements
9
+ h3. Further Reading
10
+
11
+ * "BigBench Website":http://southdesign.github.com/bigbench
12
+ * "BigBench RDoc":http://southdesign.github.com/bigbench/doc/BigBench.html
13
+
14
+ h3. Requirements
8
15
 
9
16
  * Ruby 1.9+
10
17
  * Redis - only if you're testing with multiple hosts
11
18
 
12
- h2. What is this?
13
19
 
14
- BigBench is a http penetration tool. It allows you to test the performance of any web server with very high loads.
15
20
 
16
- h2. How do the test receipts look like?
17
21
 
18
- As easy as possible. For example like this in @example.rb@:
22
+ h2. Test Receipts
23
+
24
+ How do the test receipts look like? As easy as possible. For example like this in @example.rb@:
19
25
 
20
26
  bc.. configure => {
21
27
  :duration => 2.minutes,
22
28
  :output => "example.ljson",
23
- :threads => 5
29
+ :users => 5,
30
+ :basic_auth => ['username', 'password']
24
31
  }
25
32
 
26
33
  benchmark "default website pages" => "http://localhost:3000" do
27
34
  get "/"
28
35
  get "/blog"
29
36
  get "/imprint"
37
+ get "/admin", :basic_auth => ['username', 'password']
30
38
  end
31
39
 
32
40
  benchmark "login and logout" => "http://localhost:3000" do
33
- post "/login", { :name => "test@user.com", :password => "secret" }
34
- post "/logout"
41
+ post "/login", :params => { :name => "test@user.com", :password => "secret" }
42
+ post "/logout", :params => { :name => "test@user.com" }
35
43
  end
36
44
 
37
- h2. Can I test with a single machine?
38
45
 
39
- Yes, BigBench allows you to run your tests against every host from your local machine. The command for this looks like this:
46
+
47
+
48
+ h2. Single Host vs. Multiple Hosts Testing
49
+
50
+ You can either test with a single machine right from your local host, or with multiple machines using bots. No matter what, the test receipt will stay the same.
51
+
52
+ h3. Single Host
53
+
54
+ BigBench allows you to run your tests against every host from your local machine. The command for this looks like this:
40
55
 
41
56
  bc.. bigbench run local example.rb
42
57
 
43
- h2. Can I also test on multiple machines?
58
+ h3. Multiple Hosts with Bots
44
59
 
45
- Yes! BigBench uses a bot design pattern which means you can run your tests from multiple hosts. Everything you need for this is a redis that
46
- is reachable from all testing hosts. Every host simply starts a bot that is checking for a new test receipt every minute like this:
60
+ BigBench uses a bot design pattern which means you can run your tests from multiple hosts. Everything you need for this is a redis that is reachable from all testing hosts. Every host simply starts a bot that is checking for a new test receipt every minute like this:
47
61
 
48
62
  bc.. bigbench start bot redis_url:port redis_password
49
63
 
50
- Then to run the tests from all hosts simply use the same receipt as you would use for a local run and call it like this:
64
+ p. Then to run the tests from all hosts simply use the same receipt as you would use for a local run and call it like this:
51
65
 
52
66
  bc.. bigbench run bots example.rb redis_url:port redis_password
53
67
 
54
- This will upload the test receipt to all bots and make them run it. Every bot reports its results back to the redis and the local machine then
55
- combines, and writes them to the output file. So you test with the same receipts and get the same results, no matter if your testing from the local host
56
- or with multiple bots.
68
+ p. This will upload the test receipt to all bots and make them run it. Every bot reports its results back to the redis and the local machine then combines, and writes them to the output file. So you test with the same receipts and get the same results, no matter if your testing from the local host or with multiple bots.
57
69
 
58
- h3. How does the recorded output look like?
59
70
 
60
- It's in the @*.ljson*@ format which is nothing else but a textfile with a complete JSON object on every line. It looks like this:
71
+
72
+ h2. Output
73
+
74
+ How does the recorded output look like? It's in the @*.ljson*@ format which is nothing else but a textfile with a complete JSON object on every line. It looks like this:
61
75
 
62
76
  bc.. {"elapsed":0.002233,"start":1333981203.542233,"stop":1333981203.54279,"duration":0,"benchmark":"index page","url":"http://localhost:3000/","path":"/","method":"get","status":"200"}
63
77
  {"elapsed":0.00331,"start":1333981203.5434968,"stop":1333981203.5438669,"duration":0,"benchmark":"index page","url":"http://localhost:3000/","path":"/","method":"get","status":"200"}
@@ -77,5 +91,29 @@ bc.. {"elapsed":0.002233,"start":1333981203.542233,"stop":1333981203.54279,"dura
77
91
  {"elapsed":0.01592,"start":1333981203.556119,"stop":1333981203.5564768,"duration":0,"benchmark":"index page","url":"http://localhost:3000/","path":"/","method":"get","status":"200"}
78
92
  ...
79
93
 
80
- p. The advantage with this file format is, that it can be parsed and computed very efficiently because the JSON parser doesn't have to parse a whole JSON array with
81
- with loads of objects but simply one object - line by line.
94
+ p. The advantage with this file format is, that it can be parsed and computed very efficiently because the JSON parser doesn't have to parse a whole JSON array with with loads of objects but simply one object - line by line.
95
+
96
+
97
+
98
+ h2. Load Comparison
99
+
100
+ BigBench is awfully good at creating high loads on web servers. A quick benchmark comparison to "Apache's JMeter":http://jmeter.apache.org/ shows that BigBench is able to create 16% more load than JMeter.
101
+
102
+ h3. Test Configuration: Apache's JMeter vs. BigBench
103
+
104
+ |_. Parameter |_. Value |
105
+ | Test Duration | 2 Minutes |
106
+ | Concurrency(Threads) | 20 |
107
+ | Rack Server | Thin |
108
+ | Rack Host | localhost |
109
+ | Rack Request | GET: 200, Body: "Test" |
110
+ | Ruby Version | ruby 1.9.3p125 [x86_64-darwin11.3.0] |
111
+ | JMeter Version | 2.6 r1237317 |
112
+ | BigBench Version | 0.2 |
113
+
114
+ h3. Test Results
115
+
116
+ |_. Value |_. JMeter |_. BigBench |
117
+ | Total Requests | 48.014 | 55.484 |
118
+ | Requests/sec | 377 | 462 |
119
+ | Percentages | 100%% | 116% |
data/Rakefile CHANGED
@@ -1,4 +1,5 @@
1
1
  require "bundler/gem_tasks"
2
+ require "rack"
2
3
 
3
4
  namespace :bigbench do
4
5
 
@@ -7,4 +8,10 @@ namespace :bigbench do
7
8
  `rdoc --main BigBench --include lib/bigbench/help/ && open doc/index.html`
8
9
  end
9
10
 
11
+ desc "Start Thin RDoc Testserver"
12
+ task :testserver do
13
+ load "spec/lib/test_web_server.rb"
14
+ Rack::Handler::Thin.run Sinatra::Application, :Port => 3001
15
+ end
16
+
10
17
  end
@@ -23,7 +23,12 @@ Gem::Specification.new do |s|
23
23
  s.add_development_dependency "active_support"
24
24
  s.add_development_dependency "rack"
25
25
  s.add_development_dependency "thin"
26
+ s.add_development_dependency "eventmachine"
27
+ s.add_development_dependency "em-http-request"
28
+ s.add_development_dependency "sinatra"
26
29
 
27
30
  s.add_runtime_dependency "redis"
28
31
  s.add_runtime_dependency "active_support"
32
+ s.add_runtime_dependency "eventmachine"
33
+ s.add_runtime_dependency "em-http-request"
29
34
  end
@@ -0,0 +1,78 @@
1
+ require 'benchmark'
2
+ require 'net/http'
3
+ require 'eventmachine'
4
+ require 'em-http'
5
+ require 'active_support/all'
6
+
7
+ { :test => :a }.to_json
8
+
9
+ n = 1_000
10
+ uri = URI("http://localhost:3000/")
11
+
12
+ Benchmark.bm do |benchmark|
13
+
14
+ benchmark.report "single start block" do
15
+
16
+ Net::HTTP.start(uri.host, uri.port) do |http|
17
+ 0.upto(n) do
18
+ request = Net::HTTP::Get.new(uri.request_uri)
19
+ response = http.request(request)
20
+ end
21
+ end
22
+
23
+ end
24
+
25
+ benchmark.report "straight http object" do
26
+
27
+ Net::HTTP.start(uri.host, uri.port) do |http|
28
+ 0.upto(n) do
29
+ http.get(uri.request_uri)
30
+ end
31
+ end
32
+
33
+ end
34
+
35
+ benchmark.report "new start block" do
36
+
37
+ 0.upto(n) do
38
+ Net::HTTP.start(uri.host, uri.port) do |http|
39
+ request = Net::HTTP::Get.new(uri.request_uri)
40
+ response = http.request(request)
41
+ end
42
+ end
43
+
44
+ end
45
+
46
+ class EventMachineLoop
47
+ def initialize loops
48
+ @total_loops, @loops = loops, 0
49
+ end
50
+
51
+ def request!
52
+ http = EventMachine::HttpRequest.new('http://localhost:3000').get
53
+ http.callback { |http|
54
+ @loops += 1
55
+ http.response
56
+ all_requests_done? ? EM.stop : request!
57
+ }
58
+ http.errback { |http|
59
+ puts "EventMachine Request Error: #{http.error} #{http.inspect}"
60
+ EM.stop
61
+ }
62
+ end
63
+
64
+ def all_requests_done?
65
+ @loops >= @total_loops
66
+ end
67
+ end
68
+
69
+ benchmark.report "em sync" do
70
+
71
+ looper = EventMachineLoop.new(n)
72
+ EventMachine.run {
73
+ looper.request!
74
+ }
75
+
76
+ end
77
+
78
+ end
@@ -0,0 +1,13 @@
1
+ require 'eventmachine'
2
+ require 'net/http'
3
+ require 'em-http'
4
+
5
+
6
+
7
+ describe "Nothing" do
8
+ it "should endlessly run the eventmachine" do
9
+ #EventMachine.run {
10
+ # Test
11
+ #}
12
+ end
13
+ end
@@ -0,0 +1,49 @@
1
+ require 'benchmark'
2
+ require 'active_support/all'
3
+
4
+ { :test => :a }.to_json
5
+
6
+ n = 50_000
7
+
8
+ Benchmark.bm do |benchmark|
9
+
10
+ benchmark.report "hash tracking" do
11
+
12
+ @trackings = []
13
+ 0.upto(n) do
14
+ @trackings << {
15
+ :elapsed => 0.23465723,
16
+ :start => 1273651762534712,
17
+ :stop => 1273658172365915,
18
+ :duration => 23,
19
+ :benchmark => "Some value",
20
+ :url => "http://localhost:3000",
21
+ :path => "/",
22
+ :method => "GET",
23
+ :status => 200
24
+ }
25
+ end
26
+
27
+ end
28
+
29
+ benchmark.report "hash-to_json tracking" do
30
+
31
+ @trackings = []
32
+ 0.upto(n) do
33
+ @trackings << {
34
+ :elapsed => 0.23465723,
35
+ :start => 1273651762534712,
36
+ :stop => 1273658172365915,
37
+ :duration => 23,
38
+ :benchmark => "Some value",
39
+ :url => "http://localhost:3000",
40
+ :path => "/",
41
+ :method => "GET",
42
+ :status => 200
43
+ }.to_json
44
+ end
45
+
46
+ end
47
+
48
+
49
+ end
@@ -47,6 +47,7 @@
47
47
  <nav id="file-list-section" class="section">
48
48
  <h3 class="section-header">Defined In</h3>
49
49
  <ul>
50
+ <li>lib/bigbench/benchmark/looper.rb
50
51
  <li>lib/bigbench/benchmark.rb
51
52
  <li>lib/bigbench/bot.rb
52
53
  <li>lib/bigbench/configuration.rb
@@ -126,6 +127,8 @@
126
127
 
127
128
  <li><a href="./BigBench/Benchmark/Benchmark.html">BigBench::Benchmark::Benchmark</a>
128
129
 
130
+ <li><a href="./BigBench/Benchmark/Looper.html">BigBench::Benchmark::Looper</a>
131
+
129
132
  <li><a href="./BigBench/Bot.html">BigBench::Bot</a>
130
133
 
131
134
  <li><a href="./BigBench/Configuration.html">BigBench::Configuration</a>
@@ -154,14 +157,14 @@
154
157
 
155
158
  <li><a href="./BigBench/Tracker/Tracker.html">BigBench::Tracker::Tracker</a>
156
159
 
160
+ <li><a href="./EventMachineLoop.html">EventMachineLoop</a>
161
+
157
162
  <li><a href="./Float.html">Float</a>
158
163
 
159
164
  <li><a href="./Helpers.html">Helpers</a>
160
165
 
161
166
  <li><a href="./Object.html">Object</a>
162
167
 
163
- <li><a href="./TestWebServer.html">TestWebServer</a>
164
-
165
168
  </ul>
166
169
  </nav>
167
170
 
@@ -223,18 +226,19 @@
223
226
  <span class="ruby-identifier">get</span> <span class="ruby-string">&quot;/&quot;</span>
224
227
  <span class="ruby-identifier">get</span> <span class="ruby-string">&quot;/blog&quot;</span>
225
228
  <span class="ruby-identifier">get</span> <span class="ruby-string">&quot;/imprint&quot;</span>
229
+ <span class="ruby-identifier">get</span> <span class="ruby-string">&quot;/admin&quot;</span>, :<span class="ruby-identifier">basic_auth</span> =<span class="ruby-operator">&gt;</span> [<span class="ruby-string">'admin'</span>, <span class="ruby-string">'secret'</span>]
226
230
  <span class="ruby-keyword">end</span>
227
231
 
228
232
  <span class="ruby-identifier">benchmark</span> <span class="ruby-string">&quot;login and logout&quot;</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-string">&quot;http://localhost:3000&quot;</span> <span class="ruby-keyword">do</span>
229
- <span class="ruby-identifier">post</span> <span class="ruby-string">&quot;/login&quot;</span>, { :<span class="ruby-identifier">name</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-string">&quot;test@user.com&quot;</span>, :<span class="ruby-identifier">password</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-string">&quot;secret&quot;</span> }
230
- <span class="ruby-identifier">post</span> <span class="ruby-string">&quot;http://localhost:3000/logout&quot;</span>
233
+ <span class="ruby-identifier">post</span> <span class="ruby-string">&quot;/login&quot;</span>, :<span class="ruby-identifier">params</span> =<span class="ruby-operator">&gt;</span> { :<span class="ruby-identifier">name</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-string">&quot;test@user.com&quot;</span>, :<span class="ruby-identifier">password</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-string">&quot;secret&quot;</span> }
234
+ <span class="ruby-identifier">post</span> <span class="ruby-string">&quot;/logout&quot;</span>, :<span class="ruby-identifier">params</span> =<span class="ruby-operator">&gt;</span> { :<span class="ruby-identifier">name</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-string">&quot;test@user.com&quot;</span> }
231
235
  <span class="ruby-keyword">end</span>
232
236
  </pre>
233
237
 
234
238
 
235
239
 
236
240
  <div class="method-source-code" id="benchmark-source">
237
- <pre><span class="ruby-comment"># File lib/bigbench/benchmark.rb, line 111</span>
241
+ <pre><span class="ruby-comment"># File lib/bigbench/benchmark.rb, line 101</span>
238
242
  <span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">benchmark</span>(<span class="ruby-identifier">options</span>)
239
243
  <span class="ruby-keyword">return</span> <span class="ruby-keyword">unless</span> <span class="ruby-identifier">block_given?</span>
240
244
  <span class="ruby-constant">Benchmark</span>.<span class="ruby-identifier">add</span>(<span class="ruby-identifier">options</span>, &amp;<span class="ruby-constant">Proc</span>.<span class="ruby-identifier">new</span>)
@@ -265,7 +269,7 @@
265
269
 
266
270
 
267
271
  <div class="method-source-code" id="benchmarks-source">
268
- <pre><span class="ruby-comment"># File lib/bigbench/benchmark.rb, line 117</span>
272
+ <pre><span class="ruby-comment"># File lib/bigbench/benchmark.rb, line 107</span>
269
273
  <span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">benchmarks</span>
270
274
  <span class="ruby-constant">Benchmark</span>.<span class="ruby-identifier">all</span>
271
275
  <span class="ruby-keyword">end</span></pre>
@@ -296,7 +300,7 @@
296
300
 
297
301
 
298
302
  <div class="method-source-code" id="check_config-21-source">
299
- <pre><span class="ruby-comment"># File lib/bigbench/configuration.rb, line 104</span>
303
+ <pre><span class="ruby-comment"># File lib/bigbench/configuration.rb, line 111</span>
300
304
  <span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">check_config!</span>
301
305
  <span class="ruby-identifier">raise</span> <span class="ruby-constant">Configuration</span><span class="ruby-operator">::</span><span class="ruby-constant">InvalidOptions</span>.<span class="ruby-identifier">new</span> <span class="ruby-keyword">unless</span> <span class="ruby-identifier">config</span>.<span class="ruby-identifier">valid?</span>
302
306
  <span class="ruby-keyword">true</span>
@@ -331,7 +335,7 @@
331
335
 
332
336
 
333
337
  <div class="method-source-code" id="config-source">
334
- <pre><span class="ruby-comment"># File lib/bigbench/configuration.rb, line 99</span>
338
+ <pre><span class="ruby-comment"># File lib/bigbench/configuration.rb, line 106</span>
335
339
  <span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">config</span>
336
340
  <span class="ruby-constant">Configuration</span>.<span class="ruby-identifier">config</span>
337
341
  <span class="ruby-keyword">end</span></pre>
@@ -359,9 +363,10 @@
359
363
  <p>Configure the benchmark by supplying a hash of options like this:</p>
360
364
 
361
365
  <pre class="ruby"><span class="ruby-constant">BigBench</span>.<span class="ruby-identifier">configure</span> = {
362
- :<span class="ruby-identifier">duration</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value">10</span>.<span class="ruby-identifier">seconds</span>,
363
- :<span class="ruby-identifier">output</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-string">&quot;test.ljson&quot;</span>,
364
- :<span class="ruby-identifier">threads</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value">20</span>
366
+ :<span class="ruby-identifier">duration</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value">10</span>.<span class="ruby-identifier">seconds</span>,
367
+ :<span class="ruby-identifier">output</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-string">&quot;test.ljson&quot;</span>,
368
+ :<span class="ruby-identifier">users</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value">20</span>,
369
+ :<span class="ruby-identifier">basic_auth</span> =<span class="ruby-operator">&gt;</span> [<span class="ruby-string">'username'</span>, <span class="ruby-string">'secret'</span>]
365
370
  }
366
371
  </pre>
367
372
 
@@ -371,7 +376,7 @@
371
376
 
372
377
 
373
378
  <div class="method-source-code" id="configure-3D-source">
374
- <pre><span class="ruby-comment"># File lib/bigbench/configuration.rb, line 90</span>
379
+ <pre><span class="ruby-comment"># File lib/bigbench/configuration.rb, line 97</span>
375
380
  <span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">configure=</span>(<span class="ruby-identifier">config</span>)
376
381
  <span class="ruby-constant">Configuration</span>.<span class="ruby-identifier">configure</span>=(<span class="ruby-identifier">config</span>)
377
382
  <span class="ruby-keyword">end</span></pre>
@@ -402,7 +407,7 @@ one</p>
402
407
 
403
408
 
404
409
  <div class="method-source-code" id="duration-source">
405
- <pre><span class="ruby-comment"># File lib/bigbench/benchmark.rb, line 122</span>
410
+ <pre><span class="ruby-comment"># File lib/bigbench/benchmark.rb, line 112</span>
406
411
  <span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">duration</span>
407
412
  <span class="ruby-constant">Benchmark</span>.<span class="ruby-identifier">max_duration</span>
408
413
  <span class="ruby-keyword">end</span></pre>
@@ -440,7 +445,7 @@ end'</span>
440
445
 
441
446
 
442
447
  <div class="method-source-code" id="load_test-21-source">
443
- <pre><span class="ruby-comment"># File lib/bigbench/runner.rb, line 45</span>
448
+ <pre><span class="ruby-comment"># File lib/bigbench/runner.rb, line 46</span>
444
449
  <span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">load_test!</span>(<span class="ruby-identifier">test</span>)
445
450
  <span class="ruby-constant">BigBench</span><span class="ruby-operator">::</span><span class="ruby-constant">Benchmark</span>.<span class="ruby-identifier">reset!</span>
446
451
  <span class="ruby-identifier">eval</span>(<span class="ruby-identifier">test</span>)
@@ -473,7 +478,7 @@ end'</span>
473
478
 
474
479
 
475
480
  <div class="method-source-code" id="run-21-source">
476
- <pre><span class="ruby-comment"># File lib/bigbench/runner.rb, line 31</span>
481
+ <pre><span class="ruby-comment"># File lib/bigbench/runner.rb, line 32</span>
477
482
  <span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">run!</span>
478
483
  <span class="ruby-constant">BigBench</span><span class="ruby-operator">::</span><span class="ruby-constant">Output</span>.<span class="ruby-identifier">running_benchmarks</span>
479
484
  <span class="ruby-constant">Runner</span>.<span class="ruby-identifier">run!</span>
@@ -515,7 +520,7 @@ end'</span>
515
520
  <span class="ruby-constant">BigBench</span>.<span class="ruby-identifier">benchmarks</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">benchmark</span><span class="ruby-operator">|</span>
516
521
  <span class="ruby-identifier">benchmark</span>.<span class="ruby-identifier">tracker</span>.<span class="ruby-identifier">trackings</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">tracking</span><span class="ruby-operator">|</span>
517
522
  <span class="ruby-constant">BigBench</span><span class="ruby-operator">::</span><span class="ruby-constant">Output</span>.<span class="ruby-identifier">wrote_trackings</span>(<span class="ruby-identifier">counter</span>) <span class="ruby-keyword">if</span> <span class="ruby-identifier">counter</span> <span class="ruby-operator">%</span> <span class="ruby-value">100</span> <span class="ruby-operator">==</span> <span class="ruby-value">0</span>
518
- <span class="ruby-identifier">file</span>.<span class="ruby-identifier">write</span> <span class="ruby-identifier">tracking</span> <span class="ruby-operator">+</span> <span class="ruby-string">&quot;\n&quot;</span>
523
+ <span class="ruby-identifier">file</span>.<span class="ruby-identifier">write</span> <span class="ruby-identifier">tracking</span>.<span class="ruby-identifier">to_json</span> <span class="ruby-operator">+</span> <span class="ruby-string">&quot;\n&quot;</span>
519
524
  <span class="ruby-identifier">counter</span> <span class="ruby-operator">+=</span> <span class="ruby-value">1</span>
520
525
  <span class="ruby-keyword">end</span>
521
526
  <span class="ruby-keyword">end</span>
@@ -599,7 +604,7 @@ end'</span>
599
604
  <span class="ruby-constant">BigBench</span>.<span class="ruby-identifier">benchmarks</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">benchmark</span><span class="ruby-operator">|</span>
600
605
  <span class="ruby-identifier">benchmark</span>.<span class="ruby-identifier">tracker</span>.<span class="ruby-identifier">trackings</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">tracking</span><span class="ruby-operator">|</span>
601
606
  <span class="ruby-constant">BigBench</span><span class="ruby-operator">::</span><span class="ruby-constant">Output</span>.<span class="ruby-identifier">wrote_trackings</span>(<span class="ruby-identifier">counter</span>) <span class="ruby-keyword">if</span> <span class="ruby-identifier">counter</span> <span class="ruby-operator">%</span> <span class="ruby-value">100</span> <span class="ruby-operator">==</span> <span class="ruby-value">0</span>
602
- <span class="ruby-constant">BigBench</span><span class="ruby-operator">::</span><span class="ruby-constant">Store</span>.<span class="ruby-identifier">add_tracking</span>(<span class="ruby-identifier">tracking</span>)
607
+ <span class="ruby-constant">BigBench</span><span class="ruby-operator">::</span><span class="ruby-constant">Store</span>.<span class="ruby-identifier">add_tracking</span>(<span class="ruby-identifier">tracking</span>.<span class="ruby-identifier">to_json</span>)
603
608
  <span class="ruby-identifier">counter</span> <span class="ruby-operator">+=</span> <span class="ruby-value">1</span>
604
609
  <span class="ruby-keyword">end</span>
605
610
  <span class="ruby-keyword">end</span>