bigbench 0.0.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.
- data/.gitignore +5 -0
- data/Gemfile +4 -0
- data/README.textile +81 -0
- data/Rakefile +10 -0
- data/bigbench.gemspec +29 -0
- data/bin/bigbench +6 -0
- data/doc/BigBench.html +631 -0
- data/doc/BigBench/Benchmark.html +328 -0
- data/doc/BigBench/Benchmark/Benchmark.html +431 -0
- data/doc/BigBench/Bot.html +233 -0
- data/doc/BigBench/Configuration.html +312 -0
- data/doc/BigBench/Configuration/Config.html +375 -0
- data/doc/BigBench/Configuration/InvalidOptions.html +217 -0
- data/doc/BigBench/Executor.html +252 -0
- data/doc/BigBench/Executor/InvalidCommand.html +222 -0
- data/doc/BigBench/Fragment.html +404 -0
- data/doc/BigBench/Fragment/Fragment.html +384 -0
- data/doc/BigBench/Output.html +703 -0
- data/doc/BigBench/Runner.html +222 -0
- data/doc/BigBench/Runner/NoBenchmarksDefined.html +217 -0
- data/doc/BigBench/Store.html +639 -0
- data/doc/BigBench/Tracker.html +179 -0
- data/doc/BigBench/Tracker/Tracker.html +273 -0
- data/doc/Float.html +217 -0
- data/doc/Gemfile.html +129 -0
- data/doc/Helpers.html +163 -0
- data/doc/Object.html +181 -0
- data/doc/Rakefile.html +136 -0
- data/doc/TestWebServer.html +247 -0
- data/doc/created.rid +31 -0
- data/doc/images/add.png +0 -0
- data/doc/images/brick.png +0 -0
- data/doc/images/brick_link.png +0 -0
- data/doc/images/bug.png +0 -0
- data/doc/images/bullet_black.png +0 -0
- data/doc/images/bullet_toggle_minus.png +0 -0
- data/doc/images/bullet_toggle_plus.png +0 -0
- data/doc/images/date.png +0 -0
- data/doc/images/delete.png +0 -0
- data/doc/images/find.png +0 -0
- data/doc/images/loadingAnimation.gif +0 -0
- data/doc/images/macFFBgHack.png +0 -0
- data/doc/images/package.png +0 -0
- data/doc/images/page_green.png +0 -0
- data/doc/images/page_white_text.png +0 -0
- data/doc/images/page_white_width.png +0 -0
- data/doc/images/plugin.png +0 -0
- data/doc/images/ruby.png +0 -0
- data/doc/images/tag_blue.png +0 -0
- data/doc/images/tag_green.png +0 -0
- data/doc/images/transparent.png +0 -0
- data/doc/images/wrench.png +0 -0
- data/doc/images/wrench_orange.png +0 -0
- data/doc/images/zoom.png +0 -0
- data/doc/index.html +122 -0
- data/doc/js/darkfish.js +153 -0
- data/doc/js/jquery.js +18 -0
- data/doc/js/navigation.js +142 -0
- data/doc/js/search.js +94 -0
- data/doc/js/search_index.js +1 -0
- data/doc/js/searcher.js +228 -0
- data/doc/lib/bigbench/help/executor_txt.html +145 -0
- data/doc/rdoc.css +543 -0
- data/doc/table_of_contents.html +263 -0
- data/lib/bigbench.rb +18 -0
- data/lib/bigbench/benchmark.rb +126 -0
- data/lib/bigbench/bot.rb +34 -0
- data/lib/bigbench/configuration.rb +109 -0
- data/lib/bigbench/executor.rb +131 -0
- data/lib/bigbench/float_extensions.rb +6 -0
- data/lib/bigbench/fragment.rb +119 -0
- data/lib/bigbench/help/executor.txt +17 -0
- data/lib/bigbench/initializers.rb +2 -0
- data/lib/bigbench/output.rb +116 -0
- data/lib/bigbench/runner.rb +52 -0
- data/lib/bigbench/store.rb +92 -0
- data/lib/bigbench/tracker.rb +79 -0
- data/lib/bigbench/version.rb +3 -0
- data/spec/benchmark_spec.rb +69 -0
- data/spec/bot_spec.rb +31 -0
- data/spec/configure_spec.rb +39 -0
- data/spec/executor_spec.rb +80 -0
- data/spec/fragment_spec.rb +110 -0
- data/spec/helpers.rb +19 -0
- data/spec/lib/test_web_server.rb +18 -0
- data/spec/runner_spec.rb +40 -0
- data/spec/store_spec.rb +72 -0
- data/spec/tests/local.rb +15 -0
- data/spec/tests/local_invalid.rb +9 -0
- data/spec/tracker_spec.rb +50 -0
- data/spec/webserver_spec.rb +35 -0
- metadata +220 -0
data/Gemfile
ADDED
data/README.textile
ADDED
@@ -0,0 +1,81 @@
|
|
1
|
+
h1. BigBench
|
2
|
+
|
3
|
+
h2. Installation
|
4
|
+
|
5
|
+
bc.. gem install bigbench
|
6
|
+
|
7
|
+
h2. Requirements
|
8
|
+
|
9
|
+
* Ruby 1.9+
|
10
|
+
* Redis - only if you're testing with multiple hosts
|
11
|
+
|
12
|
+
h2. What is this?
|
13
|
+
|
14
|
+
BigBench is a http penetration tool. It allows you to test the performance of any web server with very high loads.
|
15
|
+
|
16
|
+
h2. How do the test receipts look like?
|
17
|
+
|
18
|
+
As easy as possible. For example like this in @example.rb@:
|
19
|
+
|
20
|
+
bc.. configure => {
|
21
|
+
:duration => 2.minutes,
|
22
|
+
:output => "example.ljson",
|
23
|
+
:threads => 5
|
24
|
+
}
|
25
|
+
|
26
|
+
benchmark "default website pages" => "http://localhost:3000" do
|
27
|
+
get "/"
|
28
|
+
get "/blog"
|
29
|
+
get "/imprint"
|
30
|
+
end
|
31
|
+
|
32
|
+
benchmark "login and logout" => "http://localhost:3000" do
|
33
|
+
post "/login", { :name => "test@user.com", :password => "secret" }
|
34
|
+
post "/logout"
|
35
|
+
end
|
36
|
+
|
37
|
+
h2. Can I test with a single machine?
|
38
|
+
|
39
|
+
Yes, BigBench allows you to run your tests against every host from your local machine. The command for this looks like this:
|
40
|
+
|
41
|
+
bc.. bigbench run local example.rb
|
42
|
+
|
43
|
+
h2. Can I also test on multiple machines?
|
44
|
+
|
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:
|
47
|
+
|
48
|
+
bc.. bigbench start bot redis_url:port redis_password
|
49
|
+
|
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:
|
51
|
+
|
52
|
+
bc.. bigbench run bots example.rb redis_url:port redis_password
|
53
|
+
|
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.
|
57
|
+
|
58
|
+
h3. How does the recorded output look like?
|
59
|
+
|
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:
|
61
|
+
|
62
|
+
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
|
+
{"elapsed":0.00331,"start":1333981203.5434968,"stop":1333981203.5438669,"duration":0,"benchmark":"index page","url":"http://localhost:3000/","path":"/","method":"get","status":"200"}
|
64
|
+
{"elapsed":0.004248,"start":1333981203.544449,"stop":1333981203.544805,"duration":0,"benchmark":"index page","url":"http://localhost:3000/","path":"/","method":"get","status":"200"}
|
65
|
+
{"elapsed":0.00521,"start":1333981203.545397,"stop":1333981203.5457668,"duration":0,"benchmark":"index page","url":"http://localhost:3000/","path":"/","method":"get","status":"200"}
|
66
|
+
{"elapsed":0.00615,"start":1333981203.546355,"stop":1333981203.546707,"duration":0,"benchmark":"index page","url":"http://localhost:3000/","path":"/","method":"get","status":"200"}
|
67
|
+
{"elapsed":0.007127,"start":1333981203.547328,"stop":1333981203.5476842,"duration":0,"benchmark":"index page","url":"http://localhost:3000/","path":"/","method":"get","status":"200"}
|
68
|
+
{"elapsed":0.008024,"start":1333981203.548226,"stop":1333981203.5485811,"duration":0,"benchmark":"index page","url":"http://localhost:3000/","path":"/","method":"get","status":"200"}
|
69
|
+
{"elapsed":0.008904,"start":1333981203.549105,"stop":1333981203.549461,"duration":0,"benchmark":"index page","url":"http://localhost:3000/","path":"/","method":"get","status":"200"}
|
70
|
+
{"elapsed":0.009803,"start":1333981203.550003,"stop":1333981203.55036,"duration":0,"benchmark":"index page","url":"http://localhost:3000/","path":"/","method":"get","status":"200"}
|
71
|
+
{"elapsed":0.010678,"start":1333981203.550882,"stop":1333981203.551235,"duration":0,"benchmark":"index page","url":"http://localhost:3000/","path":"/","method":"get","status":"200"}
|
72
|
+
{"elapsed":0.011549,"start":1333981203.5517519,"stop":1333981203.552106,"duration":0,"benchmark":"index page","url":"http://localhost:3000/","path":"/","method":"get","status":"200"}
|
73
|
+
{"elapsed":0.012417,"start":1333981203.5526242,"stop":1333981203.552974,"duration":0,"benchmark":"index page","url":"http://localhost:3000/","path":"/","method":"get","status":"200"}
|
74
|
+
{"elapsed":0.013294,"start":1333981203.553495,"stop":1333981203.553851,"duration":0,"benchmark":"index page","url":"http://localhost:3000/","path":"/","method":"get","status":"200"}
|
75
|
+
{"elapsed":0.014166,"start":1333981203.5543702,"stop":1333981203.554723,"duration":0,"benchmark":"index page","url":"http://localhost:3000/","path":"/","method":"get","status":"200"}
|
76
|
+
{"elapsed":0.015043,"start":1333981203.555247,"stop":1333981203.5556,"duration":0,"benchmark":"index page","url":"http://localhost:3000/","path":"/","method":"get","status":"200"}
|
77
|
+
{"elapsed":0.01592,"start":1333981203.556119,"stop":1333981203.5564768,"duration":0,"benchmark":"index page","url":"http://localhost:3000/","path":"/","method":"get","status":"200"}
|
78
|
+
...
|
79
|
+
|
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.
|
data/Rakefile
ADDED
data/bigbench.gemspec
ADDED
@@ -0,0 +1,29 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
$:.push File.expand_path("../lib", __FILE__)
|
3
|
+
require "bigbench/version"
|
4
|
+
|
5
|
+
Gem::Specification.new do |s|
|
6
|
+
s.name = "bigbench"
|
7
|
+
s.version = BigBench::VERSION
|
8
|
+
s.authors = ["Thomas Fankhauser"]
|
9
|
+
s.email = ["tommylefunk@googlemail.com"]
|
10
|
+
s.homepage = "http://southdesign.github.com/bigbench"
|
11
|
+
s.summary = %q{A large scale ruby penetration tool}
|
12
|
+
s.description = %q{Setup a network of bots only waiting to attack a few lonesome servers and force them to their limits}
|
13
|
+
|
14
|
+
s.rubyforge_project = "bigbench"
|
15
|
+
|
16
|
+
s.files = `git ls-files`.split("\n")
|
17
|
+
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
18
|
+
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
19
|
+
s.require_paths = ["lib"]
|
20
|
+
s.rdoc_options << '--include' << 'lib/bigbench/help/'
|
21
|
+
|
22
|
+
s.add_development_dependency "rspec"
|
23
|
+
s.add_development_dependency "active_support"
|
24
|
+
s.add_development_dependency "rack"
|
25
|
+
s.add_development_dependency "thin"
|
26
|
+
|
27
|
+
s.add_runtime_dependency "redis"
|
28
|
+
s.add_runtime_dependency "active_support"
|
29
|
+
end
|
data/bin/bigbench
ADDED
data/doc/BigBench.html
ADDED
@@ -0,0 +1,631 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
|
3
|
+
<html>
|
4
|
+
<head>
|
5
|
+
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
|
6
|
+
|
7
|
+
<title>module BigBench - RDoc Documentation</title>
|
8
|
+
|
9
|
+
<link type="text/css" media="screen" href="./rdoc.css" rel="stylesheet">
|
10
|
+
|
11
|
+
<script type="text/javascript">
|
12
|
+
var rdoc_rel_prefix = "./";
|
13
|
+
</script>
|
14
|
+
|
15
|
+
<script type="text/javascript" charset="utf-8" src="./js/jquery.js"></script>
|
16
|
+
<script type="text/javascript" charset="utf-8" src="./js/navigation.js"></script>
|
17
|
+
<script type="text/javascript" charset="utf-8" src="./js/search_index.js"></script>
|
18
|
+
<script type="text/javascript" charset="utf-8" src="./js/search.js"></script>
|
19
|
+
<script type="text/javascript" charset="utf-8" src="./js/searcher.js"></script>
|
20
|
+
<script type="text/javascript" charset="utf-8" src="./js/darkfish.js"></script>
|
21
|
+
|
22
|
+
|
23
|
+
<body id="top" class="module">
|
24
|
+
<nav id="metadata">
|
25
|
+
<nav id="home-section" class="section">
|
26
|
+
<h3 class="section-header">
|
27
|
+
<a href="./index.html">Home</a>
|
28
|
+
<a href="./table_of_contents.html#classes">Classes</a>
|
29
|
+
<a href="./table_of_contents.html#methods">Methods</a>
|
30
|
+
</h3>
|
31
|
+
</nav>
|
32
|
+
|
33
|
+
|
34
|
+
<nav id="search-section" class="section project-section" class="initially-hidden">
|
35
|
+
<form action="#" method="get" accept-charset="utf-8">
|
36
|
+
<h3 class="section-header">
|
37
|
+
<input type="text" name="search" placeholder="Search" id="search-field"
|
38
|
+
title="Type to search, Up and Down to navigate, Enter to load">
|
39
|
+
</h3>
|
40
|
+
</form>
|
41
|
+
|
42
|
+
<ul id="search-results" class="initially-hidden"></ul>
|
43
|
+
</nav>
|
44
|
+
|
45
|
+
|
46
|
+
<div id="file-metadata">
|
47
|
+
<nav id="file-list-section" class="section">
|
48
|
+
<h3 class="section-header">Defined In</h3>
|
49
|
+
<ul>
|
50
|
+
<li>lib/bigbench/benchmark.rb
|
51
|
+
<li>lib/bigbench/bot.rb
|
52
|
+
<li>lib/bigbench/configuration.rb
|
53
|
+
<li>lib/bigbench/executor.rb
|
54
|
+
<li>lib/bigbench/fragment.rb
|
55
|
+
<li>lib/bigbench/output.rb
|
56
|
+
<li>lib/bigbench/runner.rb
|
57
|
+
<li>lib/bigbench/store.rb
|
58
|
+
<li>lib/bigbench/tracker.rb
|
59
|
+
<li>lib/bigbench/version.rb
|
60
|
+
</ul>
|
61
|
+
</nav>
|
62
|
+
|
63
|
+
|
64
|
+
</div>
|
65
|
+
|
66
|
+
<div id="class-metadata">
|
67
|
+
|
68
|
+
|
69
|
+
|
70
|
+
<!-- Method Quickref -->
|
71
|
+
<nav id="method-list-section" class="section">
|
72
|
+
<h3 class="section-header">Methods</h3>
|
73
|
+
|
74
|
+
<ul class="link-list">
|
75
|
+
|
76
|
+
<li><a href="#method-c-benchmark">::benchmark</a>
|
77
|
+
|
78
|
+
<li><a href="#method-c-benchmarks">::benchmarks</a>
|
79
|
+
|
80
|
+
<li><a href="#method-c-check_config-21">::check_config!</a>
|
81
|
+
|
82
|
+
<li><a href="#method-c-config">::config</a>
|
83
|
+
|
84
|
+
<li><a href="#method-c-configure-3D">::configure=</a>
|
85
|
+
|
86
|
+
<li><a href="#method-c-duration">::duration</a>
|
87
|
+
|
88
|
+
<li><a href="#method-c-load_test-21">::load_test!</a>
|
89
|
+
|
90
|
+
<li><a href="#method-c-run-21">::run!</a>
|
91
|
+
|
92
|
+
<li><a href="#method-c-write_local_trackings_to_file-21">::write_local_trackings_to_file!</a>
|
93
|
+
|
94
|
+
<li><a href="#method-c-write_store_trackings_to_file-21">::write_store_trackings_to_file!</a>
|
95
|
+
|
96
|
+
<li><a href="#method-c-write_trackings_to_store-21">::write_trackings_to_store!</a>
|
97
|
+
|
98
|
+
</ul>
|
99
|
+
</nav>
|
100
|
+
|
101
|
+
</div>
|
102
|
+
|
103
|
+
<div id="project-metadata">
|
104
|
+
<nav id="fileindex-section" class="section project-section">
|
105
|
+
<h3 class="section-header">Pages</h3>
|
106
|
+
|
107
|
+
<ul>
|
108
|
+
|
109
|
+
<li class="file"><a href="./Gemfile.html">Gemfile</a>
|
110
|
+
|
111
|
+
<li class="file"><a href="./Rakefile.html">Rakefile</a>
|
112
|
+
|
113
|
+
<li class="file"><a href="./lib/bigbench/help/executor_txt.html">executor</a>
|
114
|
+
|
115
|
+
</ul>
|
116
|
+
</nav>
|
117
|
+
|
118
|
+
<nav id="classindex-section" class="section project-section">
|
119
|
+
<h3 class="section-header">Class and Module Index</h3>
|
120
|
+
|
121
|
+
<ul class="link-list">
|
122
|
+
|
123
|
+
<li><a href="./BigBench.html">BigBench</a>
|
124
|
+
|
125
|
+
<li><a href="./BigBench/Benchmark.html">BigBench::Benchmark</a>
|
126
|
+
|
127
|
+
<li><a href="./BigBench/Benchmark/Benchmark.html">BigBench::Benchmark::Benchmark</a>
|
128
|
+
|
129
|
+
<li><a href="./BigBench/Bot.html">BigBench::Bot</a>
|
130
|
+
|
131
|
+
<li><a href="./BigBench/Configuration.html">BigBench::Configuration</a>
|
132
|
+
|
133
|
+
<li><a href="./BigBench/Configuration/Config.html">BigBench::Configuration::Config</a>
|
134
|
+
|
135
|
+
<li><a href="./BigBench/Configuration/InvalidOptions.html">BigBench::Configuration::InvalidOptions</a>
|
136
|
+
|
137
|
+
<li><a href="./BigBench/Executor.html">BigBench::Executor</a>
|
138
|
+
|
139
|
+
<li><a href="./BigBench/Executor/InvalidCommand.html">BigBench::Executor::InvalidCommand</a>
|
140
|
+
|
141
|
+
<li><a href="./BigBench/Fragment.html">BigBench::Fragment</a>
|
142
|
+
|
143
|
+
<li><a href="./BigBench/Fragment/Fragment.html">BigBench::Fragment::Fragment</a>
|
144
|
+
|
145
|
+
<li><a href="./BigBench/Output.html">BigBench::Output</a>
|
146
|
+
|
147
|
+
<li><a href="./BigBench/Runner.html">BigBench::Runner</a>
|
148
|
+
|
149
|
+
<li><a href="./BigBench/Runner/NoBenchmarksDefined.html">BigBench::Runner::NoBenchmarksDefined</a>
|
150
|
+
|
151
|
+
<li><a href="./BigBench/Store.html">BigBench::Store</a>
|
152
|
+
|
153
|
+
<li><a href="./BigBench/Tracker.html">BigBench::Tracker</a>
|
154
|
+
|
155
|
+
<li><a href="./BigBench/Tracker/Tracker.html">BigBench::Tracker::Tracker</a>
|
156
|
+
|
157
|
+
<li><a href="./Float.html">Float</a>
|
158
|
+
|
159
|
+
<li><a href="./Helpers.html">Helpers</a>
|
160
|
+
|
161
|
+
<li><a href="./Object.html">Object</a>
|
162
|
+
|
163
|
+
<li><a href="./TestWebServer.html">TestWebServer</a>
|
164
|
+
|
165
|
+
</ul>
|
166
|
+
</nav>
|
167
|
+
|
168
|
+
</div>
|
169
|
+
</nav>
|
170
|
+
|
171
|
+
<div id="documentation">
|
172
|
+
<h1 class="module">module BigBench</h1>
|
173
|
+
|
174
|
+
<div id="description" class="description">
|
175
|
+
|
176
|
+
</div><!-- description -->
|
177
|
+
|
178
|
+
|
179
|
+
|
180
|
+
|
181
|
+
<section id="5Buntitled-5D" class="documentation-section">
|
182
|
+
|
183
|
+
|
184
|
+
|
185
|
+
|
186
|
+
|
187
|
+
<!-- Constants -->
|
188
|
+
<section id="constants-list" class="section">
|
189
|
+
<h3 class="section-header">Constants</h3>
|
190
|
+
<dl>
|
191
|
+
|
192
|
+
<dt id="VERSION">VERSION
|
193
|
+
|
194
|
+
<dd class="description">
|
195
|
+
|
196
|
+
|
197
|
+
</dl>
|
198
|
+
</section>
|
199
|
+
|
200
|
+
|
201
|
+
|
202
|
+
|
203
|
+
<!-- Methods -->
|
204
|
+
|
205
|
+
<section id="public-class-5Buntitled-5D-method-details" class="method-section section">
|
206
|
+
<h3 class="section-header">Public Class Methods</h3>
|
207
|
+
|
208
|
+
|
209
|
+
<div id="method-c-benchmark" class="method-detail ">
|
210
|
+
|
211
|
+
<div class="method-heading">
|
212
|
+
<span class="method-name">benchmark</span><span
|
213
|
+
class="method-args">(options)</span>
|
214
|
+
<span class="method-click-advice">click to toggle source</span>
|
215
|
+
</div>
|
216
|
+
|
217
|
+
|
218
|
+
<div class="method-description">
|
219
|
+
|
220
|
+
<p>Add a benchmark like this:</p>
|
221
|
+
|
222
|
+
<pre class="ruby"><span class="ruby-identifier">benchmark</span> <span class="ruby-string">"default website pages"</span> =<span class="ruby-operator">></span> <span class="ruby-string">"http://localhost:3000"</span> <span class="ruby-keyword">do</span>
|
223
|
+
<span class="ruby-identifier">get</span> <span class="ruby-string">"/"</span>
|
224
|
+
<span class="ruby-identifier">get</span> <span class="ruby-string">"/blog"</span>
|
225
|
+
<span class="ruby-identifier">get</span> <span class="ruby-string">"/imprint"</span>
|
226
|
+
<span class="ruby-keyword">end</span>
|
227
|
+
|
228
|
+
<span class="ruby-identifier">benchmark</span> <span class="ruby-string">"login and logout"</span> =<span class="ruby-operator">></span> <span class="ruby-string">"http://localhost:3000"</span> <span class="ruby-keyword">do</span>
|
229
|
+
<span class="ruby-identifier">post</span> <span class="ruby-string">"/login"</span>, { :<span class="ruby-identifier">name</span> =<span class="ruby-operator">></span> <span class="ruby-string">"test@user.com"</span>, :<span class="ruby-identifier">password</span> =<span class="ruby-operator">></span> <span class="ruby-string">"secret"</span> }
|
230
|
+
<span class="ruby-identifier">post</span> <span class="ruby-string">"http://localhost:3000/logout"</span>
|
231
|
+
<span class="ruby-keyword">end</span>
|
232
|
+
</pre>
|
233
|
+
|
234
|
+
|
235
|
+
|
236
|
+
<div class="method-source-code" id="benchmark-source">
|
237
|
+
<pre><span class="ruby-comment"># File lib/bigbench/benchmark.rb, line 111</span>
|
238
|
+
<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
|
+
<span class="ruby-keyword">return</span> <span class="ruby-keyword">unless</span> <span class="ruby-identifier">block_given?</span>
|
240
|
+
<span class="ruby-constant">Benchmark</span>.<span class="ruby-identifier">add</span>(<span class="ruby-identifier">options</span>, &<span class="ruby-constant">Proc</span>.<span class="ruby-identifier">new</span>)
|
241
|
+
<span class="ruby-keyword">end</span></pre>
|
242
|
+
</div><!-- benchmark-source -->
|
243
|
+
|
244
|
+
</div>
|
245
|
+
|
246
|
+
|
247
|
+
|
248
|
+
|
249
|
+
</div><!-- benchmark-method -->
|
250
|
+
|
251
|
+
|
252
|
+
<div id="method-c-benchmarks" class="method-detail ">
|
253
|
+
|
254
|
+
<div class="method-heading">
|
255
|
+
<span class="method-name">benchmarks</span><span
|
256
|
+
class="method-args">()</span>
|
257
|
+
<span class="method-click-advice">click to toggle source</span>
|
258
|
+
</div>
|
259
|
+
|
260
|
+
|
261
|
+
<div class="method-description">
|
262
|
+
|
263
|
+
<p>List all available benchmarks</p>
|
264
|
+
|
265
|
+
|
266
|
+
|
267
|
+
<div class="method-source-code" id="benchmarks-source">
|
268
|
+
<pre><span class="ruby-comment"># File lib/bigbench/benchmark.rb, line 117</span>
|
269
|
+
<span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">benchmarks</span>
|
270
|
+
<span class="ruby-constant">Benchmark</span>.<span class="ruby-identifier">all</span>
|
271
|
+
<span class="ruby-keyword">end</span></pre>
|
272
|
+
</div><!-- benchmarks-source -->
|
273
|
+
|
274
|
+
</div>
|
275
|
+
|
276
|
+
|
277
|
+
|
278
|
+
|
279
|
+
</div><!-- benchmarks-method -->
|
280
|
+
|
281
|
+
|
282
|
+
<div id="method-c-check_config-21" class="method-detail ">
|
283
|
+
|
284
|
+
<div class="method-heading">
|
285
|
+
<span class="method-name">check_config!</span><span
|
286
|
+
class="method-args">()</span>
|
287
|
+
<span class="method-click-advice">click to toggle source</span>
|
288
|
+
</div>
|
289
|
+
|
290
|
+
|
291
|
+
<div class="method-description">
|
292
|
+
|
293
|
+
<p>Checks if all necessary config options are set and raises an
|
294
|
+
<code>InvalidOptions</code> exception if not</p>
|
295
|
+
|
296
|
+
|
297
|
+
|
298
|
+
<div class="method-source-code" id="check_config-21-source">
|
299
|
+
<pre><span class="ruby-comment"># File lib/bigbench/configuration.rb, line 104</span>
|
300
|
+
<span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">check_config!</span>
|
301
|
+
<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
|
+
<span class="ruby-keyword">true</span>
|
303
|
+
<span class="ruby-keyword">end</span></pre>
|
304
|
+
</div><!-- check_config-21-source -->
|
305
|
+
|
306
|
+
</div>
|
307
|
+
|
308
|
+
|
309
|
+
|
310
|
+
|
311
|
+
</div><!-- check_config-21-method -->
|
312
|
+
|
313
|
+
|
314
|
+
<div id="method-c-config" class="method-detail ">
|
315
|
+
|
316
|
+
<div class="method-heading">
|
317
|
+
<span class="method-name">config</span><span
|
318
|
+
class="method-args">()</span>
|
319
|
+
<span class="method-click-advice">click to toggle source</span>
|
320
|
+
</div>
|
321
|
+
|
322
|
+
|
323
|
+
<div class="method-description">
|
324
|
+
|
325
|
+
<p>Set and retreive the config values like this:</p>
|
326
|
+
|
327
|
+
<pre class="ruby"><span class="ruby-constant">BigBench</span>.<span class="ruby-identifier">config</span>.<span class="ruby-identifier">duration</span> <span class="ruby-comment"># => 10.seconds</span>
|
328
|
+
<span class="ruby-constant">BigBench</span>.<span class="ruby-identifier">config</span>.<span class="ruby-identifier">duration</span> = <span class="ruby-value">20</span>.<span class="ruby-identifier">minutes</span>
|
329
|
+
</pre>
|
330
|
+
|
331
|
+
|
332
|
+
|
333
|
+
<div class="method-source-code" id="config-source">
|
334
|
+
<pre><span class="ruby-comment"># File lib/bigbench/configuration.rb, line 99</span>
|
335
|
+
<span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">config</span>
|
336
|
+
<span class="ruby-constant">Configuration</span>.<span class="ruby-identifier">config</span>
|
337
|
+
<span class="ruby-keyword">end</span></pre>
|
338
|
+
</div><!-- config-source -->
|
339
|
+
|
340
|
+
</div>
|
341
|
+
|
342
|
+
|
343
|
+
|
344
|
+
|
345
|
+
</div><!-- config-method -->
|
346
|
+
|
347
|
+
|
348
|
+
<div id="method-c-configure-3D" class="method-detail ">
|
349
|
+
|
350
|
+
<div class="method-heading">
|
351
|
+
<span class="method-name">configure=</span><span
|
352
|
+
class="method-args">(config)</span>
|
353
|
+
<span class="method-click-advice">click to toggle source</span>
|
354
|
+
</div>
|
355
|
+
|
356
|
+
|
357
|
+
<div class="method-description">
|
358
|
+
|
359
|
+
<p>Configure the benchmark by supplying a hash of options like this:</p>
|
360
|
+
|
361
|
+
<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">></span> <span class="ruby-value">10</span>.<span class="ruby-identifier">seconds</span>,
|
363
|
+
:<span class="ruby-identifier">output</span> =<span class="ruby-operator">></span> <span class="ruby-string">"test.ljson"</span>,
|
364
|
+
:<span class="ruby-identifier">threads</span> =<span class="ruby-operator">></span> <span class="ruby-value">20</span>
|
365
|
+
}
|
366
|
+
</pre>
|
367
|
+
|
368
|
+
<p>Those values can then be set and retreived with
|
369
|
+
<code>BigBench.config.duration</code>, …</p>
|
370
|
+
|
371
|
+
|
372
|
+
|
373
|
+
<div class="method-source-code" id="configure-3D-source">
|
374
|
+
<pre><span class="ruby-comment"># File lib/bigbench/configuration.rb, line 90</span>
|
375
|
+
<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
|
+
<span class="ruby-constant">Configuration</span>.<span class="ruby-identifier">configure</span>=(<span class="ruby-identifier">config</span>)
|
377
|
+
<span class="ruby-keyword">end</span></pre>
|
378
|
+
</div><!-- configure-3D-source -->
|
379
|
+
|
380
|
+
</div>
|
381
|
+
|
382
|
+
|
383
|
+
|
384
|
+
|
385
|
+
</div><!-- configure-3D-method -->
|
386
|
+
|
387
|
+
|
388
|
+
<div id="method-c-duration" class="method-detail ">
|
389
|
+
|
390
|
+
<div class="method-heading">
|
391
|
+
<span class="method-name">duration</span><span
|
392
|
+
class="method-args">()</span>
|
393
|
+
<span class="method-click-advice">click to toggle source</span>
|
394
|
+
</div>
|
395
|
+
|
396
|
+
|
397
|
+
<div class="method-description">
|
398
|
+
|
399
|
+
<p>Returns the duration of all benchmarks - ergo the duration of the longest
|
400
|
+
one</p>
|
401
|
+
|
402
|
+
|
403
|
+
|
404
|
+
<div class="method-source-code" id="duration-source">
|
405
|
+
<pre><span class="ruby-comment"># File lib/bigbench/benchmark.rb, line 122</span>
|
406
|
+
<span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">duration</span>
|
407
|
+
<span class="ruby-constant">Benchmark</span>.<span class="ruby-identifier">max_duration</span>
|
408
|
+
<span class="ruby-keyword">end</span></pre>
|
409
|
+
</div><!-- duration-source -->
|
410
|
+
|
411
|
+
</div>
|
412
|
+
|
413
|
+
|
414
|
+
|
415
|
+
|
416
|
+
</div><!-- duration-method -->
|
417
|
+
|
418
|
+
|
419
|
+
<div id="method-c-load_test-21" class="method-detail ">
|
420
|
+
|
421
|
+
<div class="method-heading">
|
422
|
+
<span class="method-name">load_test!</span><span
|
423
|
+
class="method-args">(test)</span>
|
424
|
+
<span class="method-click-advice">click to toggle source</span>
|
425
|
+
</div>
|
426
|
+
|
427
|
+
|
428
|
+
<div class="method-description">
|
429
|
+
|
430
|
+
<p>Loads a test from a string file that is either parsed from a local file or
|
431
|
+
retreived from the key-value store.</p>
|
432
|
+
|
433
|
+
<pre class="ruby"><span class="ruby-identifier">benchmark_string</span> = <span class="ruby-string">'benchmark "index page" => "http://localhost:3000" do
|
434
|
+
get "/"
|
435
|
+
end'</span>
|
436
|
+
|
437
|
+
<span class="ruby-constant">BigBench</span>.<span class="ruby-identifier">load_test!</span>(<span class="ruby-identifier">benchmark_string</span>)
|
438
|
+
</pre>
|
439
|
+
|
440
|
+
|
441
|
+
|
442
|
+
<div class="method-source-code" id="load_test-21-source">
|
443
|
+
<pre><span class="ruby-comment"># File lib/bigbench/runner.rb, line 45</span>
|
444
|
+
<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
|
+
<span class="ruby-constant">BigBench</span><span class="ruby-operator">::</span><span class="ruby-constant">Benchmark</span>.<span class="ruby-identifier">reset!</span>
|
446
|
+
<span class="ruby-identifier">eval</span>(<span class="ruby-identifier">test</span>)
|
447
|
+
<span class="ruby-identifier">check_config!</span>
|
448
|
+
<span class="ruby-constant">BigBench</span><span class="ruby-operator">::</span><span class="ruby-constant">Output</span>.<span class="ruby-identifier">loaded_tests</span>
|
449
|
+
<span class="ruby-keyword">end</span></pre>
|
450
|
+
</div><!-- load_test-21-source -->
|
451
|
+
|
452
|
+
</div>
|
453
|
+
|
454
|
+
|
455
|
+
|
456
|
+
|
457
|
+
</div><!-- load_test-21-method -->
|
458
|
+
|
459
|
+
|
460
|
+
<div id="method-c-run-21" class="method-detail ">
|
461
|
+
|
462
|
+
<div class="method-heading">
|
463
|
+
<span class="method-name">run!</span><span
|
464
|
+
class="method-args">()</span>
|
465
|
+
<span class="method-click-advice">click to toggle source</span>
|
466
|
+
</div>
|
467
|
+
|
468
|
+
|
469
|
+
<div class="method-description">
|
470
|
+
|
471
|
+
<p>Runs all initialized benchmarks</p>
|
472
|
+
|
473
|
+
|
474
|
+
|
475
|
+
<div class="method-source-code" id="run-21-source">
|
476
|
+
<pre><span class="ruby-comment"># File lib/bigbench/runner.rb, line 31</span>
|
477
|
+
<span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">run!</span>
|
478
|
+
<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
|
+
<span class="ruby-constant">Runner</span>.<span class="ruby-identifier">run!</span>
|
480
|
+
<span class="ruby-constant">BigBench</span><span class="ruby-operator">::</span><span class="ruby-constant">Output</span>.<span class="ruby-identifier">finished_running_benchmarks</span>
|
481
|
+
<span class="ruby-keyword">end</span></pre>
|
482
|
+
</div><!-- run-21-source -->
|
483
|
+
|
484
|
+
</div>
|
485
|
+
|
486
|
+
|
487
|
+
|
488
|
+
|
489
|
+
</div><!-- run-21-method -->
|
490
|
+
|
491
|
+
|
492
|
+
<div id="method-c-write_local_trackings_to_file-21" class="method-detail ">
|
493
|
+
|
494
|
+
<div class="method-heading">
|
495
|
+
<span class="method-name">write_local_trackings_to_file!</span><span
|
496
|
+
class="method-args">()</span>
|
497
|
+
<span class="method-click-advice">click to toggle source</span>
|
498
|
+
</div>
|
499
|
+
|
500
|
+
|
501
|
+
<div class="method-description">
|
502
|
+
|
503
|
+
<p>Writes the locals trackings from the benchmark to a file</p>
|
504
|
+
|
505
|
+
|
506
|
+
|
507
|
+
<div class="method-source-code" id="write_local_trackings_to_file-21-source">
|
508
|
+
<pre><span class="ruby-comment"># File lib/bigbench/tracker.rb, line 45</span>
|
509
|
+
<span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">write_local_trackings_to_file!</span>
|
510
|
+
<span class="ruby-identifier">trackings</span>, <span class="ruby-identifier">counter</span> = <span class="ruby-value">0</span>, <span class="ruby-value">0</span>
|
511
|
+
<span class="ruby-constant">BigBench</span>.<span class="ruby-identifier">benchmarks</span>.<span class="ruby-identifier">each</span>{ <span class="ruby-operator">|</span><span class="ruby-identifier">benchmark</span><span class="ruby-operator">|</span> <span class="ruby-identifier">trackings</span> <span class="ruby-operator">+=</span> <span class="ruby-identifier">benchmark</span>.<span class="ruby-identifier">tracker</span>.<span class="ruby-identifier">trackings</span>.<span class="ruby-identifier">size</span> }
|
512
|
+
<span class="ruby-constant">BigBench</span><span class="ruby-operator">::</span><span class="ruby-constant">Output</span>.<span class="ruby-identifier">writing_trackings</span>(<span class="ruby-identifier">trackings</span>)
|
513
|
+
|
514
|
+
<span class="ruby-constant">File</span>.<span class="ruby-identifier">open</span>(<span class="ruby-constant">BigBench</span>.<span class="ruby-identifier">config</span>.<span class="ruby-identifier">output</span>, <span class="ruby-string">"w+"</span>) <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">file</span><span class="ruby-operator">|</span>
|
515
|
+
<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
|
+
<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
|
+
<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">"\n"</span>
|
519
|
+
<span class="ruby-identifier">counter</span> <span class="ruby-operator">+=</span> <span class="ruby-value">1</span>
|
520
|
+
<span class="ruby-keyword">end</span>
|
521
|
+
<span class="ruby-keyword">end</span>
|
522
|
+
<span class="ruby-keyword">end</span>
|
523
|
+
|
524
|
+
<span class="ruby-constant">BigBench</span><span class="ruby-operator">::</span><span class="ruby-constant">Output</span>.<span class="ruby-identifier">finished_writing_trackings</span>(<span class="ruby-identifier">counter</span>)
|
525
|
+
<span class="ruby-keyword">end</span></pre>
|
526
|
+
</div><!-- write_local_trackings_to_file-21-source -->
|
527
|
+
|
528
|
+
</div>
|
529
|
+
|
530
|
+
|
531
|
+
|
532
|
+
|
533
|
+
</div><!-- write_local_trackings_to_file-21-method -->
|
534
|
+
|
535
|
+
|
536
|
+
<div id="method-c-write_store_trackings_to_file-21" class="method-detail ">
|
537
|
+
|
538
|
+
<div class="method-heading">
|
539
|
+
<span class="method-name">write_store_trackings_to_file!</span><span
|
540
|
+
class="method-args">()</span>
|
541
|
+
<span class="method-click-advice">click to toggle source</span>
|
542
|
+
</div>
|
543
|
+
|
544
|
+
|
545
|
+
<div class="method-description">
|
546
|
+
|
547
|
+
<p>Gathers the trackings from the redis and writes them to a local file</p>
|
548
|
+
|
549
|
+
|
550
|
+
|
551
|
+
<div class="method-source-code" id="write_store_trackings_to_file-21-source">
|
552
|
+
<pre><span class="ruby-comment"># File lib/bigbench/tracker.rb, line 64</span>
|
553
|
+
<span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">write_store_trackings_to_file!</span>
|
554
|
+
<span class="ruby-identifier">trackings</span>, <span class="ruby-identifier">counter</span> = <span class="ruby-constant">BigBench</span><span class="ruby-operator">::</span><span class="ruby-constant">Store</span>.<span class="ruby-identifier">count_trackings</span>, <span class="ruby-value">0</span>
|
555
|
+
<span class="ruby-constant">BigBench</span><span class="ruby-operator">::</span><span class="ruby-constant">Output</span>.<span class="ruby-identifier">writing_trackings</span>(<span class="ruby-identifier">trackings</span>)
|
556
|
+
|
557
|
+
<span class="ruby-constant">File</span>.<span class="ruby-identifier">open</span>(<span class="ruby-constant">BigBench</span>.<span class="ruby-identifier">config</span>.<span class="ruby-identifier">output</span>, <span class="ruby-string">"w+"</span>) <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">file</span><span class="ruby-operator">|</span>
|
558
|
+
<span class="ruby-keyword">while</span> <span class="ruby-identifier">tracking</span> = <span class="ruby-constant">BigBench</span><span class="ruby-operator">::</span><span class="ruby-constant">Store</span>.<span class="ruby-identifier">pop_tracking</span> <span class="ruby-keyword">do</span>
|
559
|
+
<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>
|
560
|
+
<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">"\n"</span>
|
561
|
+
<span class="ruby-identifier">counter</span> <span class="ruby-operator">+=</span> <span class="ruby-value">1</span>
|
562
|
+
<span class="ruby-keyword">end</span>
|
563
|
+
<span class="ruby-keyword">end</span>
|
564
|
+
|
565
|
+
<span class="ruby-constant">BigBench</span><span class="ruby-operator">::</span><span class="ruby-constant">Output</span>.<span class="ruby-identifier">finished_writing_trackings</span>(<span class="ruby-identifier">counter</span>)
|
566
|
+
<span class="ruby-keyword">end</span></pre>
|
567
|
+
</div><!-- write_store_trackings_to_file-21-source -->
|
568
|
+
|
569
|
+
</div>
|
570
|
+
|
571
|
+
|
572
|
+
|
573
|
+
|
574
|
+
</div><!-- write_store_trackings_to_file-21-method -->
|
575
|
+
|
576
|
+
|
577
|
+
<div id="method-c-write_trackings_to_store-21" class="method-detail ">
|
578
|
+
|
579
|
+
<div class="method-heading">
|
580
|
+
<span class="method-name">write_trackings_to_store!</span><span
|
581
|
+
class="method-args">()</span>
|
582
|
+
<span class="method-click-advice">click to toggle source</span>
|
583
|
+
</div>
|
584
|
+
|
585
|
+
|
586
|
+
<div class="method-description">
|
587
|
+
|
588
|
+
<p>Writes the trackings of a bot to the redis after he finishes the run</p>
|
589
|
+
|
590
|
+
|
591
|
+
|
592
|
+
<div class="method-source-code" id="write_trackings_to_store-21-source">
|
593
|
+
<pre><span class="ruby-comment"># File lib/bigbench/tracker.rb, line 28</span>
|
594
|
+
<span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">write_trackings_to_store!</span>
|
595
|
+
<span class="ruby-identifier">trackings</span>, <span class="ruby-identifier">counter</span> = <span class="ruby-value">0</span>, <span class="ruby-value">0</span>
|
596
|
+
<span class="ruby-constant">BigBench</span>.<span class="ruby-identifier">benchmarks</span>.<span class="ruby-identifier">each</span>{ <span class="ruby-operator">|</span><span class="ruby-identifier">benchmark</span><span class="ruby-operator">|</span> <span class="ruby-identifier">trackings</span> <span class="ruby-operator">+=</span> <span class="ruby-identifier">benchmark</span>.<span class="ruby-identifier">tracker</span>.<span class="ruby-identifier">trackings</span>.<span class="ruby-identifier">size</span> }
|
597
|
+
<span class="ruby-constant">BigBench</span><span class="ruby-operator">::</span><span class="ruby-constant">Output</span>.<span class="ruby-identifier">writing_trackings</span>(<span class="ruby-identifier">trackings</span>)
|
598
|
+
|
599
|
+
<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
|
+
<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
|
+
<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>)
|
603
|
+
<span class="ruby-identifier">counter</span> <span class="ruby-operator">+=</span> <span class="ruby-value">1</span>
|
604
|
+
<span class="ruby-keyword">end</span>
|
605
|
+
<span class="ruby-keyword">end</span>
|
606
|
+
|
607
|
+
<span class="ruby-constant">BigBench</span><span class="ruby-operator">::</span><span class="ruby-constant">Output</span>.<span class="ruby-identifier">finished_writing_trackings</span>(<span class="ruby-identifier">counter</span>)
|
608
|
+
<span class="ruby-keyword">end</span></pre>
|
609
|
+
</div><!-- write_trackings_to_store-21-source -->
|
610
|
+
|
611
|
+
</div>
|
612
|
+
|
613
|
+
|
614
|
+
|
615
|
+
|
616
|
+
</div><!-- write_trackings_to_store-21-method -->
|
617
|
+
|
618
|
+
|
619
|
+
</section><!-- public-class-method-details -->
|
620
|
+
|
621
|
+
</section><!-- 5Buntitled-5D -->
|
622
|
+
|
623
|
+
</div><!-- documentation -->
|
624
|
+
|
625
|
+
|
626
|
+
<footer id="validator-badges">
|
627
|
+
<p><a href="http://validator.w3.org/check/referer">[Validate]</a>
|
628
|
+
<p>Generated by <a href="https://github.com/rdoc/rdoc">RDoc</a> 3.12.
|
629
|
+
<p>Generated with the <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish Rdoc Generator</a> 3.
|
630
|
+
</footer>
|
631
|
+
|