bigbench 0.0.1 → 0.0.2
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/README.textile +60 -22
- data/Rakefile +7 -0
- data/bigbench.gemspec +5 -0
- data/dev/net_http.rb +78 -0
- data/dev/test.rb +13 -0
- data/dev/tracking.rb +49 -0
- data/doc/BigBench.html +22 -17
- data/doc/BigBench/Benchmark.html +12 -8
- data/doc/BigBench/Benchmark/Benchmark.html +17 -27
- data/doc/BigBench/Benchmark/Looper.html +340 -0
- data/doc/BigBench/Bot.html +4 -2
- data/doc/BigBench/Configuration.html +20 -11
- data/doc/BigBench/Configuration/Config.html +23 -8
- data/doc/BigBench/Configuration/InvalidOptions.html +5 -3
- data/doc/BigBench/Executor.html +4 -2
- data/doc/BigBench/Executor/InvalidCommand.html +4 -2
- data/doc/BigBench/Fragment.html +46 -29
- data/doc/BigBench/Fragment/Fragment.html +18 -28
- data/doc/BigBench/Output.html +4 -2
- data/doc/BigBench/Runner.html +12 -9
- data/doc/BigBench/Runner/NoBenchmarksDefined.html +4 -2
- data/doc/BigBench/Store.html +4 -2
- data/doc/BigBench/Tracker.html +4 -2
- data/doc/BigBench/Tracker/Tracker.html +5 -3
- data/doc/EventMachineLoop.html +296 -0
- data/doc/Float.html +4 -2
- data/doc/Gemfile.html +4 -2
- data/doc/Helpers.html +4 -2
- data/doc/Object.html +87 -2
- data/doc/Rakefile.html +10 -3
- data/doc/created.rid +36 -31
- data/doc/index.html +4 -2
- data/doc/js/search_index.js +1 -1
- data/doc/lib/bigbench/help/executor_txt.html +4 -2
- data/doc/table_of_contents.html +31 -16
- data/lib/bigbench.rb +3 -0
- data/lib/bigbench/benchmark.rb +11 -21
- data/lib/bigbench/benchmark/looper.rb +43 -0
- data/lib/bigbench/configuration.rb +17 -10
- data/lib/bigbench/fragment.rb +47 -34
- data/lib/bigbench/runner.rb +8 -7
- data/lib/bigbench/tracker.rb +3 -3
- data/lib/bigbench/version.rb +1 -1
- data/spec/benchmark_spec.rb +14 -7
- data/spec/configure_spec.rb +3 -3
- data/spec/fragment_spec.rb +186 -24
- data/spec/helpers.rb +2 -4
- data/spec/lib/test_web_server.rb +44 -15
- data/spec/looper_spec.rb +47 -0
- data/spec/tests/local.rb +1 -1
- data/spec/webserver_spec.rb +91 -21
- metadata +77 -15
data/doc/BigBench/Bot.html
CHANGED
@@ -97,6 +97,8 @@
|
|
97
97
|
|
98
98
|
<li><a href="../BigBench/Benchmark/Benchmark.html">BigBench::Benchmark::Benchmark</a>
|
99
99
|
|
100
|
+
<li><a href="../BigBench/Benchmark/Looper.html">BigBench::Benchmark::Looper</a>
|
101
|
+
|
100
102
|
<li><a href="../BigBench/Bot.html">BigBench::Bot</a>
|
101
103
|
|
102
104
|
<li><a href="../BigBench/Configuration.html">BigBench::Configuration</a>
|
@@ -125,14 +127,14 @@
|
|
125
127
|
|
126
128
|
<li><a href="../BigBench/Tracker/Tracker.html">BigBench::Tracker::Tracker</a>
|
127
129
|
|
130
|
+
<li><a href="../EventMachineLoop.html">EventMachineLoop</a>
|
131
|
+
|
128
132
|
<li><a href="../Float.html">Float</a>
|
129
133
|
|
130
134
|
<li><a href="../Helpers.html">Helpers</a>
|
131
135
|
|
132
136
|
<li><a href="../Object.html">Object</a>
|
133
137
|
|
134
|
-
<li><a href="../TestWebServer.html">TestWebServer</a>
|
135
|
-
|
136
138
|
</ul>
|
137
139
|
</nav>
|
138
140
|
|
@@ -101,6 +101,8 @@
|
|
101
101
|
|
102
102
|
<li><a href="../BigBench/Benchmark/Benchmark.html">BigBench::Benchmark::Benchmark</a>
|
103
103
|
|
104
|
+
<li><a href="../BigBench/Benchmark/Looper.html">BigBench::Benchmark::Looper</a>
|
105
|
+
|
104
106
|
<li><a href="../BigBench/Bot.html">BigBench::Bot</a>
|
105
107
|
|
106
108
|
<li><a href="../BigBench/Configuration.html">BigBench::Configuration</a>
|
@@ -129,14 +131,14 @@
|
|
129
131
|
|
130
132
|
<li><a href="../BigBench/Tracker/Tracker.html">BigBench::Tracker::Tracker</a>
|
131
133
|
|
134
|
+
<li><a href="../EventMachineLoop.html">EventMachineLoop</a>
|
135
|
+
|
132
136
|
<li><a href="../Float.html">Float</a>
|
133
137
|
|
134
138
|
<li><a href="../Helpers.html">Helpers</a>
|
135
139
|
|
136
140
|
<li><a href="../Object.html">Object</a>
|
137
141
|
|
138
|
-
<li><a href="../TestWebServer.html">TestWebServer</a>
|
139
|
-
|
140
142
|
</ul>
|
141
143
|
</nav>
|
142
144
|
|
@@ -151,9 +153,10 @@
|
|
151
153
|
<p>The configuration is configured in the test reciepts and looks like this:</p>
|
152
154
|
|
153
155
|
<pre class="ruby"><span class="ruby-constant">BigBench</span>.<span class="ruby-identifier">configure</span> = {
|
154
|
-
:<span class="ruby-identifier">duration</span>
|
155
|
-
:<span class="ruby-identifier">output</span>
|
156
|
-
:<span class="ruby-identifier">
|
156
|
+
:<span class="ruby-identifier">duration</span> =<span class="ruby-operator">></span> <span class="ruby-value">10</span>.<span class="ruby-identifier">seconds</span>,
|
157
|
+
:<span class="ruby-identifier">output</span> =<span class="ruby-operator">></span> <span class="ruby-string">"test.ljson"</span>,
|
158
|
+
:<span class="ruby-identifier">users</span> =<span class="ruby-operator">></span> <span class="ruby-value">20</span>,
|
159
|
+
:<span class="ruby-identifier">basic_auth</span> =<span class="ruby-operator">></span> [<span class="ruby-string">'username'</span>, <span class="ruby-string">'secret'</span>]
|
157
160
|
}
|
158
161
|
</pre>
|
159
162
|
|
@@ -176,10 +179,16 @@ by every benchmark.</p>
|
|
176
179
|
valid JSON object on every line. This makes it easy to process the results
|
177
180
|
later on, because there’s no need to parse the whole results JSON, which
|
178
181
|
can get huge, at once.</p>
|
179
|
-
</dd><dt>
|
182
|
+
</dd><dt>users
|
180
183
|
<dd>
|
181
|
-
<p>How many
|
182
|
-
benchmark and defaults to <code>1</code>.</p>
|
184
|
+
<p>How many users execute the benchmarks concurrently. This can be overridden
|
185
|
+
by every benchmark and defaults to <code>1</code>.</p>
|
186
|
+
</dd><dt>basic_auth
|
187
|
+
<dd>
|
188
|
+
<p>A basic authentication that is used by ALL requests. This can be overridden
|
189
|
+
per fragment in every benchmark.</p>
|
190
|
+
|
191
|
+
<pre>BigBench.config.basic_auth = ['username', 'password']</pre>
|
183
192
|
</dd></dl>
|
184
193
|
|
185
194
|
</div><!-- description -->
|
@@ -218,7 +227,7 @@ benchmark and defaults to <code>1</code>.</p>
|
|
218
227
|
|
219
228
|
|
220
229
|
<div class="method-source-code" id="config-source">
|
221
|
-
<pre><span class="ruby-comment"># File lib/bigbench/configuration.rb, line
|
230
|
+
<pre><span class="ruby-comment"># File lib/bigbench/configuration.rb, line 76</span>
|
222
231
|
<span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">config</span>
|
223
232
|
<span class="ruby-ivar">@config</span>
|
224
233
|
<span class="ruby-keyword">end</span></pre>
|
@@ -249,7 +258,7 @@ present yet, they are added to the config object</p>
|
|
249
258
|
|
250
259
|
|
251
260
|
<div class="method-source-code" id="configure-3D-source">
|
252
|
-
<pre><span class="ruby-comment"># File lib/bigbench/configuration.rb, line
|
261
|
+
<pre><span class="ruby-comment"># File lib/bigbench/configuration.rb, line 67</span>
|
253
262
|
<span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">configure=</span>(<span class="ruby-identifier">config</span>)
|
254
263
|
<span class="ruby-identifier">raise</span> <span class="ruby-string">"Config must be a Hash"</span> <span class="ruby-keyword">unless</span> <span class="ruby-identifier">config</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">Hash</span>)
|
255
264
|
<span class="ruby-identifier">config</span>.<span class="ruby-identifier">each</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">option</span>, <span class="ruby-identifier">value</span><span class="ruby-operator">|</span>
|
@@ -283,7 +292,7 @@ present yet, they are added to the config object</p>
|
|
283
292
|
|
284
293
|
|
285
294
|
<div class="method-source-code" id="reset-21-source">
|
286
|
-
<pre><span class="ruby-comment"># File lib/bigbench/configuration.rb, line
|
295
|
+
<pre><span class="ruby-comment"># File lib/bigbench/configuration.rb, line 81</span>
|
287
296
|
<span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">reset!</span>
|
288
297
|
<span class="ruby-ivar">@config</span> = <span class="ruby-constant">Config</span>.<span class="ruby-identifier">new</span>
|
289
298
|
<span class="ruby-keyword">end</span></pre>
|
@@ -107,6 +107,8 @@
|
|
107
107
|
|
108
108
|
<li><a href="../../BigBench/Benchmark/Benchmark.html">BigBench::Benchmark::Benchmark</a>
|
109
109
|
|
110
|
+
<li><a href="../../BigBench/Benchmark/Looper.html">BigBench::Benchmark::Looper</a>
|
111
|
+
|
110
112
|
<li><a href="../../BigBench/Bot.html">BigBench::Bot</a>
|
111
113
|
|
112
114
|
<li><a href="../../BigBench/Configuration.html">BigBench::Configuration</a>
|
@@ -135,14 +137,14 @@
|
|
135
137
|
|
136
138
|
<li><a href="../../BigBench/Tracker/Tracker.html">BigBench::Tracker::Tracker</a>
|
137
139
|
|
140
|
+
<li><a href="../../EventMachineLoop.html">EventMachineLoop</a>
|
141
|
+
|
138
142
|
<li><a href="../../Float.html">Float</a>
|
139
143
|
|
140
144
|
<li><a href="../../Helpers.html">Helpers</a>
|
141
145
|
|
142
146
|
<li><a href="../../Object.html">Object</a>
|
143
147
|
|
144
|
-
<li><a href="../../TestWebServer.html">TestWebServer</a>
|
145
|
-
|
146
148
|
</ul>
|
147
149
|
</nav>
|
148
150
|
|
@@ -189,6 +191,19 @@ is <code>valid?</code></p>
|
|
189
191
|
<h3 class="section-header">Attributes</h3>
|
190
192
|
|
191
193
|
|
194
|
+
<div id="attribute-i-basic_auth" class="method-detail">
|
195
|
+
<div class="method-heading attribute-method-heading">
|
196
|
+
<span class="method-name">basic_auth</span><span
|
197
|
+
class="attribute-access-type">[RW]</span>
|
198
|
+
</div>
|
199
|
+
|
200
|
+
<div class="method-description">
|
201
|
+
|
202
|
+
|
203
|
+
|
204
|
+
</div>
|
205
|
+
</div>
|
206
|
+
|
192
207
|
<div id="attribute-i-bot_checks_every" class="method-detail">
|
193
208
|
<div class="method-heading attribute-method-heading">
|
194
209
|
<span class="method-name">bot_checks_every</span><span
|
@@ -241,9 +256,9 @@ is <code>valid?</code></p>
|
|
241
256
|
</div>
|
242
257
|
</div>
|
243
258
|
|
244
|
-
<div id="attribute-i-
|
259
|
+
<div id="attribute-i-users" class="method-detail">
|
245
260
|
<div class="method-heading attribute-method-heading">
|
246
|
-
<span class="method-name">
|
261
|
+
<span class="method-name">users</span><span
|
247
262
|
class="attribute-access-type">[RW]</span>
|
248
263
|
</div>
|
249
264
|
|
@@ -279,7 +294,7 @@ is <code>valid?</code></p>
|
|
279
294
|
|
280
295
|
|
281
296
|
<div class="method-source-code" id="add_option-source">
|
282
|
-
<pre><span class="ruby-comment"># File lib/bigbench/configuration.rb, line
|
297
|
+
<pre><span class="ruby-comment"># File lib/bigbench/configuration.rb, line 46</span>
|
283
298
|
<span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">add_option</span>(<span class="ruby-identifier">name</span>)
|
284
299
|
<span class="ruby-identifier">attr_accessor</span> <span class="ruby-identifier">name</span> <span class="ruby-keyword">unless</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">respond_to?</span>(<span class="ruby-identifier">name</span>)
|
285
300
|
<span class="ruby-keyword">end</span></pre>
|
@@ -309,9 +324,9 @@ is <code>valid?</code></p>
|
|
309
324
|
|
310
325
|
|
311
326
|
<div class="method-source-code" id="new-source">
|
312
|
-
<pre><span class="ruby-comment"># File lib/bigbench/configuration.rb, line
|
327
|
+
<pre><span class="ruby-comment"># File lib/bigbench/configuration.rb, line 42</span>
|
313
328
|
<span class="ruby-keyword">def</span> <span class="ruby-identifier">initialize</span>
|
314
|
-
<span class="ruby-ivar">@
|
329
|
+
<span class="ruby-ivar">@users</span>, <span class="ruby-ivar">@duration</span>, <span class="ruby-ivar">@mode</span>, <span class="ruby-ivar">@bot_checks_every</span> = <span class="ruby-value">1</span>, <span class="ruby-value">1</span>.<span class="ruby-identifier">second</span>, <span class="ruby-value">:local</span>, <span class="ruby-value">1</span>.<span class="ruby-identifier">minute</span>
|
315
330
|
<span class="ruby-keyword">end</span></pre>
|
316
331
|
</div><!-- new-source -->
|
317
332
|
|
@@ -345,7 +360,7 @@ is <code>valid?</code></p>
|
|
345
360
|
|
346
361
|
|
347
362
|
<div class="method-source-code" id="valid-3F-source">
|
348
|
-
<pre><span class="ruby-comment"># File lib/bigbench/configuration.rb, line
|
363
|
+
<pre><span class="ruby-comment"># File lib/bigbench/configuration.rb, line 50</span>
|
349
364
|
<span class="ruby-keyword">def</span> <span class="ruby-identifier">valid?</span>
|
350
365
|
<span class="ruby-constant">VALIDATE_OPTIONS</span>.<span class="ruby-identifier">each</span>{ <span class="ruby-operator">|</span><span class="ruby-identifier">option</span><span class="ruby-operator">|</span> <span class="ruby-keyword">return</span> <span class="ruby-keyword">false</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">send</span>(<span class="ruby-identifier">option</span>).<span class="ruby-identifier">nil?</span> }
|
351
366
|
<span class="ruby-keyword">true</span>
|
@@ -103,6 +103,8 @@
|
|
103
103
|
|
104
104
|
<li><a href="../../BigBench/Benchmark/Benchmark.html">BigBench::Benchmark::Benchmark</a>
|
105
105
|
|
106
|
+
<li><a href="../../BigBench/Benchmark/Looper.html">BigBench::Benchmark::Looper</a>
|
107
|
+
|
106
108
|
<li><a href="../../BigBench/Bot.html">BigBench::Bot</a>
|
107
109
|
|
108
110
|
<li><a href="../../BigBench/Configuration.html">BigBench::Configuration</a>
|
@@ -131,14 +133,14 @@
|
|
131
133
|
|
132
134
|
<li><a href="../../BigBench/Tracker/Tracker.html">BigBench::Tracker::Tracker</a>
|
133
135
|
|
136
|
+
<li><a href="../../EventMachineLoop.html">EventMachineLoop</a>
|
137
|
+
|
134
138
|
<li><a href="../../Float.html">Float</a>
|
135
139
|
|
136
140
|
<li><a href="../../Helpers.html">Helpers</a>
|
137
141
|
|
138
142
|
<li><a href="../../Object.html">Object</a>
|
139
143
|
|
140
|
-
<li><a href="../../TestWebServer.html">TestWebServer</a>
|
141
|
-
|
142
144
|
</ul>
|
143
145
|
</nav>
|
144
146
|
|
@@ -188,7 +190,7 @@
|
|
188
190
|
|
189
191
|
|
190
192
|
<div class="method-source-code" id="message-source">
|
191
|
-
<pre><span class="ruby-comment"># File lib/bigbench/configuration.rb, line
|
193
|
+
<pre><span class="ruby-comment"># File lib/bigbench/configuration.rb, line 58</span>
|
192
194
|
<span class="ruby-keyword">def</span> <span class="ruby-identifier">message</span>
|
193
195
|
<span class="ruby-node">"At least: #{Config::VALIDATE_OPTIONS.join(', ')} are required"</span>
|
194
196
|
<span class="ruby-keyword">end</span></pre>
|
data/doc/BigBench/Executor.html
CHANGED
@@ -97,6 +97,8 @@
|
|
97
97
|
|
98
98
|
<li><a href="../BigBench/Benchmark/Benchmark.html">BigBench::Benchmark::Benchmark</a>
|
99
99
|
|
100
|
+
<li><a href="../BigBench/Benchmark/Looper.html">BigBench::Benchmark::Looper</a>
|
101
|
+
|
100
102
|
<li><a href="../BigBench/Bot.html">BigBench::Bot</a>
|
101
103
|
|
102
104
|
<li><a href="../BigBench/Configuration.html">BigBench::Configuration</a>
|
@@ -125,14 +127,14 @@
|
|
125
127
|
|
126
128
|
<li><a href="../BigBench/Tracker/Tracker.html">BigBench::Tracker::Tracker</a>
|
127
129
|
|
130
|
+
<li><a href="../EventMachineLoop.html">EventMachineLoop</a>
|
131
|
+
|
128
132
|
<li><a href="../Float.html">Float</a>
|
129
133
|
|
130
134
|
<li><a href="../Helpers.html">Helpers</a>
|
131
135
|
|
132
136
|
<li><a href="../Object.html">Object</a>
|
133
137
|
|
134
|
-
<li><a href="../TestWebServer.html">TestWebServer</a>
|
135
|
-
|
136
138
|
</ul>
|
137
139
|
</nav>
|
138
140
|
|
@@ -103,6 +103,8 @@
|
|
103
103
|
|
104
104
|
<li><a href="../../BigBench/Benchmark/Benchmark.html">BigBench::Benchmark::Benchmark</a>
|
105
105
|
|
106
|
+
<li><a href="../../BigBench/Benchmark/Looper.html">BigBench::Benchmark::Looper</a>
|
107
|
+
|
106
108
|
<li><a href="../../BigBench/Bot.html">BigBench::Bot</a>
|
107
109
|
|
108
110
|
<li><a href="../../BigBench/Configuration.html">BigBench::Configuration</a>
|
@@ -131,14 +133,14 @@
|
|
131
133
|
|
132
134
|
<li><a href="../../BigBench/Tracker/Tracker.html">BigBench::Tracker::Tracker</a>
|
133
135
|
|
136
|
+
<li><a href="../../EventMachineLoop.html">EventMachineLoop</a>
|
137
|
+
|
134
138
|
<li><a href="../../Float.html">Float</a>
|
135
139
|
|
136
140
|
<li><a href="../../Helpers.html">Helpers</a>
|
137
141
|
|
138
142
|
<li><a href="../../Object.html">Object</a>
|
139
143
|
|
140
|
-
<li><a href="../../TestWebServer.html">TestWebServer</a>
|
141
|
-
|
142
144
|
</ul>
|
143
145
|
</nav>
|
144
146
|
|
data/doc/BigBench/Fragment.html
CHANGED
@@ -107,6 +107,8 @@
|
|
107
107
|
|
108
108
|
<li><a href="../BigBench/Benchmark/Benchmark.html">BigBench::Benchmark::Benchmark</a>
|
109
109
|
|
110
|
+
<li><a href="../BigBench/Benchmark/Looper.html">BigBench::Benchmark::Looper</a>
|
111
|
+
|
110
112
|
<li><a href="../BigBench/Bot.html">BigBench::Bot</a>
|
111
113
|
|
112
114
|
<li><a href="../BigBench/Configuration.html">BigBench::Configuration</a>
|
@@ -135,14 +137,14 @@
|
|
135
137
|
|
136
138
|
<li><a href="../BigBench/Tracker/Tracker.html">BigBench::Tracker::Tracker</a>
|
137
139
|
|
140
|
+
<li><a href="../EventMachineLoop.html">EventMachineLoop</a>
|
141
|
+
|
138
142
|
<li><a href="../Float.html">Float</a>
|
139
143
|
|
140
144
|
<li><a href="../Helpers.html">Helpers</a>
|
141
145
|
|
142
146
|
<li><a href="../Object.html">Object</a>
|
143
147
|
|
144
|
-
<li><a href="../TestWebServer.html">TestWebServer</a>
|
145
|
-
|
146
148
|
</ul>
|
147
149
|
</nav>
|
148
150
|
|
@@ -167,11 +169,29 @@ test reciepts:</p>
|
|
167
169
|
They look like this:</p>
|
168
170
|
|
169
171
|
<pre class="ruby"><span class="ruby-identifier">get</span> <span class="ruby-string">"/"</span>
|
170
|
-
<span class="ruby-identifier">post</span> <span class="ruby-string">"/login/new"</span
|
171
|
-
<span class="ruby-identifier">put</span> <span class="ruby-string">"/books"</span
|
172
|
-
<span class="ruby-identifier">delete</span> <span class="ruby-string">"/books/5"</span>
|
172
|
+
<span class="ruby-identifier">post</span> <span class="ruby-string">"/login/new"</span>
|
173
|
+
<span class="ruby-identifier">put</span> <span class="ruby-string">"/books"</span>
|
174
|
+
<span class="ruby-identifier">delete</span> <span class="ruby-string">"/books/5"</span>, :<span class="ruby-identifier">params</span> =<span class="ruby-operator">></span> { :<span class="ruby-identifier">token</span> =<span class="ruby-operator">></span> <span class="ruby-string">'87bas67dfjgbrjbbgbi6ica7s0b3t0'</span> }
|
175
|
+
<span class="ruby-identifier">get</span> <span class="ruby-string">"/admin"</span>, :<span class="ruby-identifier">basic_auth</span> =<span class="ruby-operator">></span> [<span class="ruby-string">'username'</span>, <span class="ruby-string">'password'</span>]
|
173
176
|
</pre>
|
174
177
|
|
178
|
+
<p>After any fragment an options hash can be appended. Possible options are:</p>
|
179
|
+
<dl class="rdoc-list label-list"><dt>:basic_auth
|
180
|
+
<dd>
|
181
|
+
<p>Supply a basic auth user and password for the request. The request then
|
182
|
+
looks like this:</p>
|
183
|
+
|
184
|
+
<pre class="ruby"><span class="ruby-identifier">get</span> <span class="ruby-string">"/"</span>, :<span class="ruby-identifier">basic_auth</span> =<span class="ruby-operator">></span> [<span class="ruby-string">'username'</span>, <span class="ruby-string">'password'</span>]
|
185
|
+
</pre>
|
186
|
+
</dd><dt>:params
|
187
|
+
<dd>
|
188
|
+
<p>Supply params for the request body, like e.g. form data:</p>
|
189
|
+
|
190
|
+
<pre class="ruby"><span class="ruby-identifier">post</span> <span class="ruby-string">"/books/new"</span>, :<span class="ruby-identifier">params</span> =<span class="ruby-operator">></span> { :<span class="ruby-identifier">book</span> =<span class="ruby-operator">></span> { :<span class="ruby-identifier">title</span> =<span class="ruby-operator">></span> <span class="ruby-string">"Metaprogramming Ruby"</span>, :<span class="ruby-identifier">publisher</span> =<span class="ruby-operator">></span> <span class="ruby-string">"O'Reilly"</span> } }
|
191
|
+
<span class="ruby-identifier">post</span> <span class="ruby-string">"/trackings/add"</span>, :<span class="ruby-identifier">params</span> =<span class="ruby-operator">></span> { :<span class="ruby-identifier">name</span> =<span class="ruby-operator">></span> <span class="ruby-string">"Tommy"</span> }
|
192
|
+
</pre>
|
193
|
+
</dd></dl>
|
194
|
+
|
175
195
|
</div><!-- description -->
|
176
196
|
|
177
197
|
|
@@ -196,7 +216,7 @@ They look like this:</p>
|
|
196
216
|
|
197
217
|
<div class="method-heading">
|
198
218
|
<span class="method-name">delete</span><span
|
199
|
-
class="method-args">(path,
|
219
|
+
class="method-args">(path, options = {})</span>
|
200
220
|
<span class="method-click-advice">click to toggle source</span>
|
201
221
|
</div>
|
202
222
|
|
@@ -205,15 +225,14 @@ They look like this:</p>
|
|
205
225
|
|
206
226
|
<p>Performs a DELETE request to the given url, e.g.</p>
|
207
227
|
|
208
|
-
<pre
|
209
|
-
</pre>
|
228
|
+
<pre>delete "/books/5"</pre>
|
210
229
|
|
211
230
|
|
212
231
|
|
213
232
|
<div class="method-source-code" id="delete-source">
|
214
|
-
<pre><span class="ruby-comment"># File lib/bigbench/fragment.rb, line
|
215
|
-
<span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">delete</span>(<span class="ruby-identifier">path</span>, <span class="ruby-identifier">
|
216
|
-
<span class="ruby-ivar">@fragments</span> <span class="ruby-operator"><<</span> <span class="ruby-constant">Fragment</span>.<span class="ruby-identifier">new</span>(<span class="ruby-ivar">@benchmark</span>, <span class="ruby-identifier">path</span>, <span class="ruby-value">:delete</span>, <span class="ruby-identifier">
|
233
|
+
<pre><span class="ruby-comment"># File lib/bigbench/fragment.rb, line 112</span>
|
234
|
+
<span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">delete</span>(<span class="ruby-identifier">path</span>, <span class="ruby-identifier">options</span> = {})
|
235
|
+
<span class="ruby-ivar">@fragments</span> <span class="ruby-operator"><<</span> <span class="ruby-constant">Fragment</span>.<span class="ruby-identifier">new</span>(<span class="ruby-ivar">@benchmark</span>, <span class="ruby-identifier">path</span>, <span class="ruby-value">:delete</span>, <span class="ruby-identifier">options</span>)
|
217
236
|
<span class="ruby-keyword">end</span></pre>
|
218
237
|
</div><!-- delete-source -->
|
219
238
|
|
@@ -229,7 +248,7 @@ They look like this:</p>
|
|
229
248
|
|
230
249
|
<div class="method-heading">
|
231
250
|
<span class="method-name">get</span><span
|
232
|
-
class="method-args">(path)</span>
|
251
|
+
class="method-args">(path, options = {})</span>
|
233
252
|
<span class="method-click-advice">click to toggle source</span>
|
234
253
|
</div>
|
235
254
|
|
@@ -243,9 +262,9 @@ They look like this:</p>
|
|
243
262
|
|
244
263
|
|
245
264
|
<div class="method-source-code" id="get-source">
|
246
|
-
<pre><span class="ruby-comment"># File lib/bigbench/fragment.rb, line
|
247
|
-
<span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">get</span>(<span class="ruby-identifier">path</span>)
|
248
|
-
<span class="ruby-ivar">@fragments</span> <span class="ruby-operator"><<</span> <span class="ruby-constant">Fragment</span>.<span class="ruby-identifier">new</span>(<span class="ruby-ivar">@benchmark</span>, <span class="ruby-identifier">path</span>, <span class="ruby-value">:get</span>,
|
265
|
+
<pre><span class="ruby-comment"># File lib/bigbench/fragment.rb, line 88</span>
|
266
|
+
<span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">get</span>(<span class="ruby-identifier">path</span>, <span class="ruby-identifier">options</span> = {})
|
267
|
+
<span class="ruby-ivar">@fragments</span> <span class="ruby-operator"><<</span> <span class="ruby-constant">Fragment</span>.<span class="ruby-identifier">new</span>(<span class="ruby-ivar">@benchmark</span>, <span class="ruby-identifier">path</span>, <span class="ruby-value">:get</span>, <span class="ruby-identifier">options</span>)
|
249
268
|
<span class="ruby-keyword">end</span></pre>
|
250
269
|
</div><!-- get-source -->
|
251
270
|
|
@@ -274,7 +293,7 @@ fully configured fragments for it</p>
|
|
274
293
|
|
275
294
|
|
276
295
|
<div class="method-source-code" id="parse-source">
|
277
|
-
<pre><span class="ruby-comment"># File lib/bigbench/fragment.rb, line
|
296
|
+
<pre><span class="ruby-comment"># File lib/bigbench/fragment.rb, line 117</span>
|
278
297
|
<span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">parse</span>(<span class="ruby-identifier">benchmark</span>, &<span class="ruby-identifier">block</span>)
|
279
298
|
<span class="ruby-identifier">reset!</span>
|
280
299
|
<span class="ruby-keyword">return</span> [] <span class="ruby-keyword">if</span> <span class="ruby-identifier">block</span>.<span class="ruby-identifier">nil?</span>
|
@@ -296,7 +315,7 @@ fully configured fragments for it</p>
|
|
296
315
|
|
297
316
|
<div class="method-heading">
|
298
317
|
<span class="method-name">post</span><span
|
299
|
-
class="method-args">(path,
|
318
|
+
class="method-args">(path, options = {})</span>
|
300
319
|
<span class="method-click-advice">click to toggle source</span>
|
301
320
|
</div>
|
302
321
|
|
@@ -305,15 +324,14 @@ fully configured fragments for it</p>
|
|
305
324
|
|
306
325
|
<p>Performs a POST request to the given url, e.g.</p>
|
307
326
|
|
308
|
-
<pre
|
309
|
-
</pre>
|
327
|
+
<pre>post "/login"</pre>
|
310
328
|
|
311
329
|
|
312
330
|
|
313
331
|
<div class="method-source-code" id="post-source">
|
314
|
-
<pre><span class="ruby-comment"># File lib/bigbench/fragment.rb, line
|
315
|
-
<span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">post</span>(<span class="ruby-identifier">path</span>, <span class="ruby-identifier">
|
316
|
-
<span class="ruby-ivar">@fragments</span> <span class="ruby-operator"><<</span> <span class="ruby-constant">Fragment</span>.<span class="ruby-identifier">new</span>(<span class="ruby-ivar">@benchmark</span>, <span class="ruby-identifier">path</span>, <span class="ruby-value">:post</span>, <span class="ruby-identifier">
|
332
|
+
<pre><span class="ruby-comment"># File lib/bigbench/fragment.rb, line 96</span>
|
333
|
+
<span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">post</span>(<span class="ruby-identifier">path</span>, <span class="ruby-identifier">options</span> = {})
|
334
|
+
<span class="ruby-ivar">@fragments</span> <span class="ruby-operator"><<</span> <span class="ruby-constant">Fragment</span>.<span class="ruby-identifier">new</span>(<span class="ruby-ivar">@benchmark</span>, <span class="ruby-identifier">path</span>, <span class="ruby-value">:post</span>, <span class="ruby-identifier">options</span>)
|
317
335
|
<span class="ruby-keyword">end</span></pre>
|
318
336
|
</div><!-- post-source -->
|
319
337
|
|
@@ -329,7 +347,7 @@ fully configured fragments for it</p>
|
|
329
347
|
|
330
348
|
<div class="method-heading">
|
331
349
|
<span class="method-name">put</span><span
|
332
|
-
class="method-args">(path,
|
350
|
+
class="method-args">(path, options = {})</span>
|
333
351
|
<span class="method-click-advice">click to toggle source</span>
|
334
352
|
</div>
|
335
353
|
|
@@ -338,15 +356,14 @@ fully configured fragments for it</p>
|
|
338
356
|
|
339
357
|
<p>Performs a PUT request to the given url, e.g.</p>
|
340
358
|
|
341
|
-
<pre
|
342
|
-
</pre>
|
359
|
+
<pre>put "/books"</pre>
|
343
360
|
|
344
361
|
|
345
362
|
|
346
363
|
<div class="method-source-code" id="put-source">
|
347
|
-
<pre><span class="ruby-comment"># File lib/bigbench/fragment.rb, line
|
348
|
-
<span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">put</span>(<span class="ruby-identifier">path</span>, <span class="ruby-identifier">
|
349
|
-
<span class="ruby-ivar">@fragments</span> <span class="ruby-operator"><<</span> <span class="ruby-constant">Fragment</span>.<span class="ruby-identifier">new</span>(<span class="ruby-ivar">@benchmark</span>, <span class="ruby-identifier">path</span>, <span class="ruby-value">:put</span>, <span class="ruby-identifier">
|
364
|
+
<pre><span class="ruby-comment"># File lib/bigbench/fragment.rb, line 104</span>
|
365
|
+
<span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">put</span>(<span class="ruby-identifier">path</span>, <span class="ruby-identifier">options</span> = {})
|
366
|
+
<span class="ruby-ivar">@fragments</span> <span class="ruby-operator"><<</span> <span class="ruby-constant">Fragment</span>.<span class="ruby-identifier">new</span>(<span class="ruby-ivar">@benchmark</span>, <span class="ruby-identifier">path</span>, <span class="ruby-value">:put</span>, <span class="ruby-identifier">options</span>)
|
350
367
|
<span class="ruby-keyword">end</span></pre>
|
351
368
|
</div><!-- put-source -->
|
352
369
|
|
@@ -374,7 +391,7 @@ fully configured fragments for it</p>
|
|
374
391
|
|
375
392
|
|
376
393
|
<div class="method-source-code" id="reset-21-source">
|
377
|
-
<pre><span class="ruby-comment"># File lib/bigbench/fragment.rb, line
|
394
|
+
<pre><span class="ruby-comment"># File lib/bigbench/fragment.rb, line 126</span>
|
378
395
|
<span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">reset!</span>
|
379
396
|
<span class="ruby-ivar">@benchmark</span> = <span class="ruby-keyword">nil</span>
|
380
397
|
<span class="ruby-ivar">@fragments</span> = []
|