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.
Files changed (92) hide show
  1. data/.gitignore +5 -0
  2. data/Gemfile +4 -0
  3. data/README.textile +81 -0
  4. data/Rakefile +10 -0
  5. data/bigbench.gemspec +29 -0
  6. data/bin/bigbench +6 -0
  7. data/doc/BigBench.html +631 -0
  8. data/doc/BigBench/Benchmark.html +328 -0
  9. data/doc/BigBench/Benchmark/Benchmark.html +431 -0
  10. data/doc/BigBench/Bot.html +233 -0
  11. data/doc/BigBench/Configuration.html +312 -0
  12. data/doc/BigBench/Configuration/Config.html +375 -0
  13. data/doc/BigBench/Configuration/InvalidOptions.html +217 -0
  14. data/doc/BigBench/Executor.html +252 -0
  15. data/doc/BigBench/Executor/InvalidCommand.html +222 -0
  16. data/doc/BigBench/Fragment.html +404 -0
  17. data/doc/BigBench/Fragment/Fragment.html +384 -0
  18. data/doc/BigBench/Output.html +703 -0
  19. data/doc/BigBench/Runner.html +222 -0
  20. data/doc/BigBench/Runner/NoBenchmarksDefined.html +217 -0
  21. data/doc/BigBench/Store.html +639 -0
  22. data/doc/BigBench/Tracker.html +179 -0
  23. data/doc/BigBench/Tracker/Tracker.html +273 -0
  24. data/doc/Float.html +217 -0
  25. data/doc/Gemfile.html +129 -0
  26. data/doc/Helpers.html +163 -0
  27. data/doc/Object.html +181 -0
  28. data/doc/Rakefile.html +136 -0
  29. data/doc/TestWebServer.html +247 -0
  30. data/doc/created.rid +31 -0
  31. data/doc/images/add.png +0 -0
  32. data/doc/images/brick.png +0 -0
  33. data/doc/images/brick_link.png +0 -0
  34. data/doc/images/bug.png +0 -0
  35. data/doc/images/bullet_black.png +0 -0
  36. data/doc/images/bullet_toggle_minus.png +0 -0
  37. data/doc/images/bullet_toggle_plus.png +0 -0
  38. data/doc/images/date.png +0 -0
  39. data/doc/images/delete.png +0 -0
  40. data/doc/images/find.png +0 -0
  41. data/doc/images/loadingAnimation.gif +0 -0
  42. data/doc/images/macFFBgHack.png +0 -0
  43. data/doc/images/package.png +0 -0
  44. data/doc/images/page_green.png +0 -0
  45. data/doc/images/page_white_text.png +0 -0
  46. data/doc/images/page_white_width.png +0 -0
  47. data/doc/images/plugin.png +0 -0
  48. data/doc/images/ruby.png +0 -0
  49. data/doc/images/tag_blue.png +0 -0
  50. data/doc/images/tag_green.png +0 -0
  51. data/doc/images/transparent.png +0 -0
  52. data/doc/images/wrench.png +0 -0
  53. data/doc/images/wrench_orange.png +0 -0
  54. data/doc/images/zoom.png +0 -0
  55. data/doc/index.html +122 -0
  56. data/doc/js/darkfish.js +153 -0
  57. data/doc/js/jquery.js +18 -0
  58. data/doc/js/navigation.js +142 -0
  59. data/doc/js/search.js +94 -0
  60. data/doc/js/search_index.js +1 -0
  61. data/doc/js/searcher.js +228 -0
  62. data/doc/lib/bigbench/help/executor_txt.html +145 -0
  63. data/doc/rdoc.css +543 -0
  64. data/doc/table_of_contents.html +263 -0
  65. data/lib/bigbench.rb +18 -0
  66. data/lib/bigbench/benchmark.rb +126 -0
  67. data/lib/bigbench/bot.rb +34 -0
  68. data/lib/bigbench/configuration.rb +109 -0
  69. data/lib/bigbench/executor.rb +131 -0
  70. data/lib/bigbench/float_extensions.rb +6 -0
  71. data/lib/bigbench/fragment.rb +119 -0
  72. data/lib/bigbench/help/executor.txt +17 -0
  73. data/lib/bigbench/initializers.rb +2 -0
  74. data/lib/bigbench/output.rb +116 -0
  75. data/lib/bigbench/runner.rb +52 -0
  76. data/lib/bigbench/store.rb +92 -0
  77. data/lib/bigbench/tracker.rb +79 -0
  78. data/lib/bigbench/version.rb +3 -0
  79. data/spec/benchmark_spec.rb +69 -0
  80. data/spec/bot_spec.rb +31 -0
  81. data/spec/configure_spec.rb +39 -0
  82. data/spec/executor_spec.rb +80 -0
  83. data/spec/fragment_spec.rb +110 -0
  84. data/spec/helpers.rb +19 -0
  85. data/spec/lib/test_web_server.rb +18 -0
  86. data/spec/runner_spec.rb +40 -0
  87. data/spec/store_spec.rb +72 -0
  88. data/spec/tests/local.rb +15 -0
  89. data/spec/tests/local_invalid.rb +9 -0
  90. data/spec/tracker_spec.rb +50 -0
  91. data/spec/webserver_spec.rb +35 -0
  92. metadata +220 -0
@@ -0,0 +1,404 @@
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::Fragment - 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/fragment.rb
51
+ </ul>
52
+ </nav>
53
+
54
+
55
+ </div>
56
+
57
+ <div id="class-metadata">
58
+
59
+
60
+
61
+ <!-- Method Quickref -->
62
+ <nav id="method-list-section" class="section">
63
+ <h3 class="section-header">Methods</h3>
64
+
65
+ <ul class="link-list">
66
+
67
+ <li><a href="#method-c-delete">::delete</a>
68
+
69
+ <li><a href="#method-c-get">::get</a>
70
+
71
+ <li><a href="#method-c-parse">::parse</a>
72
+
73
+ <li><a href="#method-c-post">::post</a>
74
+
75
+ <li><a href="#method-c-put">::put</a>
76
+
77
+ <li><a href="#method-c-reset-21">::reset!</a>
78
+
79
+ </ul>
80
+ </nav>
81
+
82
+ </div>
83
+
84
+ <div id="project-metadata">
85
+ <nav id="fileindex-section" class="section project-section">
86
+ <h3 class="section-header">Pages</h3>
87
+
88
+ <ul>
89
+
90
+ <li class="file"><a href="../Gemfile.html">Gemfile</a>
91
+
92
+ <li class="file"><a href="../Rakefile.html">Rakefile</a>
93
+
94
+ <li class="file"><a href="../lib/bigbench/help/executor_txt.html">executor</a>
95
+
96
+ </ul>
97
+ </nav>
98
+
99
+ <nav id="classindex-section" class="section project-section">
100
+ <h3 class="section-header">Class and Module Index</h3>
101
+
102
+ <ul class="link-list">
103
+
104
+ <li><a href="../BigBench.html">BigBench</a>
105
+
106
+ <li><a href="../BigBench/Benchmark.html">BigBench::Benchmark</a>
107
+
108
+ <li><a href="../BigBench/Benchmark/Benchmark.html">BigBench::Benchmark::Benchmark</a>
109
+
110
+ <li><a href="../BigBench/Bot.html">BigBench::Bot</a>
111
+
112
+ <li><a href="../BigBench/Configuration.html">BigBench::Configuration</a>
113
+
114
+ <li><a href="../BigBench/Configuration/Config.html">BigBench::Configuration::Config</a>
115
+
116
+ <li><a href="../BigBench/Configuration/InvalidOptions.html">BigBench::Configuration::InvalidOptions</a>
117
+
118
+ <li><a href="../BigBench/Executor.html">BigBench::Executor</a>
119
+
120
+ <li><a href="../BigBench/Executor/InvalidCommand.html">BigBench::Executor::InvalidCommand</a>
121
+
122
+ <li><a href="../BigBench/Fragment.html">BigBench::Fragment</a>
123
+
124
+ <li><a href="../BigBench/Fragment/Fragment.html">BigBench::Fragment::Fragment</a>
125
+
126
+ <li><a href="../BigBench/Output.html">BigBench::Output</a>
127
+
128
+ <li><a href="../BigBench/Runner.html">BigBench::Runner</a>
129
+
130
+ <li><a href="../BigBench/Runner/NoBenchmarksDefined.html">BigBench::Runner::NoBenchmarksDefined</a>
131
+
132
+ <li><a href="../BigBench/Store.html">BigBench::Store</a>
133
+
134
+ <li><a href="../BigBench/Tracker.html">BigBench::Tracker</a>
135
+
136
+ <li><a href="../BigBench/Tracker/Tracker.html">BigBench::Tracker::Tracker</a>
137
+
138
+ <li><a href="../Float.html">Float</a>
139
+
140
+ <li><a href="../Helpers.html">Helpers</a>
141
+
142
+ <li><a href="../Object.html">Object</a>
143
+
144
+ <li><a href="../TestWebServer.html">TestWebServer</a>
145
+
146
+ </ul>
147
+ </nav>
148
+
149
+ </div>
150
+ </nav>
151
+
152
+ <div id="documentation">
153
+ <h1 class="module">module BigBench::Fragment</h1>
154
+
155
+ <div id="description" class="description">
156
+
157
+ <p>A fragment represents a single http request inside a benchmark. It is
158
+ executed by the benchmark and resides inside the benchmark block in the
159
+ test reciepts:</p>
160
+
161
+ <pre class="ruby"><span class="ruby-identifier">benchmark</span> <span class="ruby-string">&quot;index page&quot;</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-string">&quot;http://localhost:3000&quot;</span> <span class="ruby-keyword">do</span>
162
+ <span class="ruby-comment"># Fragments</span>
163
+ <span class="ruby-keyword">end</span>
164
+ </pre>
165
+
166
+ <p>Possible fragment types are the HTTP verbs, like GET, POST, PUT and DELETE.
167
+ They look like this:</p>
168
+
169
+ <pre class="ruby"><span class="ruby-identifier">get</span> <span class="ruby-string">&quot;/&quot;</span>
170
+ <span class="ruby-identifier">post</span> <span class="ruby-string">&quot;/login/new&quot;</span>, { :<span class="ruby-identifier">name</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-string">&quot;a name&quot;</span>, :<span class="ruby-identifier">password</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-string">&quot;secret&quot;</span> }
171
+ <span class="ruby-identifier">put</span> <span class="ruby-string">&quot;/books&quot;</span>, { :<span class="ruby-identifier">name</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-string">&quot;A Book title&quot;</span>, :<span class="ruby-identifier">rating</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value">30.4</span> }
172
+ <span class="ruby-identifier">delete</span> <span class="ruby-string">&quot;/books/5&quot;</span>
173
+ </pre>
174
+
175
+ </div><!-- description -->
176
+
177
+
178
+
179
+
180
+ <section id="5Buntitled-5D" class="documentation-section">
181
+
182
+
183
+
184
+
185
+
186
+
187
+
188
+
189
+ <!-- Methods -->
190
+
191
+ <section id="public-class-5Buntitled-5D-method-details" class="method-section section">
192
+ <h3 class="section-header">Public Class Methods</h3>
193
+
194
+
195
+ <div id="method-c-delete" class="method-detail ">
196
+
197
+ <div class="method-heading">
198
+ <span class="method-name">delete</span><span
199
+ class="method-args">(path, params = {})</span>
200
+ <span class="method-click-advice">click to toggle source</span>
201
+ </div>
202
+
203
+
204
+ <div class="method-description">
205
+
206
+ <p>Performs a DELETE request to the given url, e.g.</p>
207
+
208
+ <pre class="ruby"><span class="ruby-identifier">delete</span> <span class="ruby-string">&quot;/books/5&quot;</span>, { :<span class="ruby-identifier">user</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-string">&quot;some@sample.com&quot;</span>, :<span class="ruby-identifier">password</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-string">&quot;secret&quot;</span> }
209
+ </pre>
210
+
211
+
212
+
213
+ <div class="method-source-code" id="delete-source">
214
+ <pre><span class="ruby-comment"># File lib/bigbench/fragment.rb, line 99</span>
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">params</span> = {})
216
+ <span class="ruby-ivar">@fragments</span> <span class="ruby-operator">&lt;&lt;</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">params</span>)
217
+ <span class="ruby-keyword">end</span></pre>
218
+ </div><!-- delete-source -->
219
+
220
+ </div>
221
+
222
+
223
+
224
+
225
+ </div><!-- delete-method -->
226
+
227
+
228
+ <div id="method-c-get" class="method-detail ">
229
+
230
+ <div class="method-heading">
231
+ <span class="method-name">get</span><span
232
+ class="method-args">(path)</span>
233
+ <span class="method-click-advice">click to toggle source</span>
234
+ </div>
235
+
236
+
237
+ <div class="method-description">
238
+
239
+ <p>Performs a GET request to the given url, e.g.</p>
240
+
241
+ <pre>get &quot;/some/page&quot;</pre>
242
+
243
+
244
+
245
+ <div class="method-source-code" id="get-source">
246
+ <pre><span class="ruby-comment"># File lib/bigbench/fragment.rb, line 75</span>
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">&lt;&lt;</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>, {})
249
+ <span class="ruby-keyword">end</span></pre>
250
+ </div><!-- get-source -->
251
+
252
+ </div>
253
+
254
+
255
+
256
+
257
+ </div><!-- get-method -->
258
+
259
+
260
+ <div id="method-c-parse" class="method-detail ">
261
+
262
+ <div class="method-heading">
263
+ <span class="method-name">parse</span><span
264
+ class="method-args">(benchmark, &block)</span>
265
+ <span class="method-click-advice">click to toggle source</span>
266
+ </div>
267
+
268
+
269
+ <div class="method-description">
270
+
271
+ <p>Evaluates a benchmark block full of puts and gets and returns an array of
272
+ fully configured fragments for it</p>
273
+
274
+
275
+
276
+ <div class="method-source-code" id="parse-source">
277
+ <pre><span class="ruby-comment"># File lib/bigbench/fragment.rb, line 104</span>
278
+ <span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">parse</span>(<span class="ruby-identifier">benchmark</span>, &amp;<span class="ruby-identifier">block</span>)
279
+ <span class="ruby-identifier">reset!</span>
280
+ <span class="ruby-keyword">return</span> [] <span class="ruby-keyword">if</span> <span class="ruby-identifier">block</span>.<span class="ruby-identifier">nil?</span>
281
+ <span class="ruby-ivar">@benchmark</span> = <span class="ruby-identifier">benchmark</span>
282
+ <span class="ruby-identifier">module_exec</span>(&amp;<span class="ruby-identifier">block</span>)
283
+ <span class="ruby-ivar">@fragments</span>
284
+ <span class="ruby-keyword">end</span></pre>
285
+ </div><!-- parse-source -->
286
+
287
+ </div>
288
+
289
+
290
+
291
+
292
+ </div><!-- parse-method -->
293
+
294
+
295
+ <div id="method-c-post" class="method-detail ">
296
+
297
+ <div class="method-heading">
298
+ <span class="method-name">post</span><span
299
+ class="method-args">(path, params = {})</span>
300
+ <span class="method-click-advice">click to toggle source</span>
301
+ </div>
302
+
303
+
304
+ <div class="method-description">
305
+
306
+ <p>Performs a POST request to the given url, e.g.</p>
307
+
308
+ <pre class="ruby"><span class="ruby-identifier">post</span> <span class="ruby-string">&quot;/login&quot;</span>, { :<span class="ruby-identifier">user</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-string">&quot;some@sample.com&quot;</span>, :<span class="ruby-identifier">password</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-string">&quot;secret&quot;</span> }
309
+ </pre>
310
+
311
+
312
+
313
+ <div class="method-source-code" id="post-source">
314
+ <pre><span class="ruby-comment"># File lib/bigbench/fragment.rb, line 83</span>
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">params</span> = {})
316
+ <span class="ruby-ivar">@fragments</span> <span class="ruby-operator">&lt;&lt;</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">params</span>)
317
+ <span class="ruby-keyword">end</span></pre>
318
+ </div><!-- post-source -->
319
+
320
+ </div>
321
+
322
+
323
+
324
+
325
+ </div><!-- post-method -->
326
+
327
+
328
+ <div id="method-c-put" class="method-detail ">
329
+
330
+ <div class="method-heading">
331
+ <span class="method-name">put</span><span
332
+ class="method-args">(path, params = {})</span>
333
+ <span class="method-click-advice">click to toggle source</span>
334
+ </div>
335
+
336
+
337
+ <div class="method-description">
338
+
339
+ <p>Performs a PUT request to the given url, e.g.</p>
340
+
341
+ <pre class="ruby"><span class="ruby-identifier">put</span> <span class="ruby-string">&quot;/books&quot;</span>, { :<span class="ruby-identifier">book</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-string">&quot;Some book content&quot;</span> }
342
+ </pre>
343
+
344
+
345
+
346
+ <div class="method-source-code" id="put-source">
347
+ <pre><span class="ruby-comment"># File lib/bigbench/fragment.rb, line 91</span>
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">params</span> = {})
349
+ <span class="ruby-ivar">@fragments</span> <span class="ruby-operator">&lt;&lt;</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">params</span>)
350
+ <span class="ruby-keyword">end</span></pre>
351
+ </div><!-- put-source -->
352
+
353
+ </div>
354
+
355
+
356
+
357
+
358
+ </div><!-- put-method -->
359
+
360
+
361
+ <div id="method-c-reset-21" class="method-detail ">
362
+
363
+ <div class="method-heading">
364
+ <span class="method-name">reset!</span><span
365
+ class="method-args">()</span>
366
+ <span class="method-click-advice">click to toggle source</span>
367
+ </div>
368
+
369
+
370
+ <div class="method-description">
371
+
372
+ <p>Reset all fragments</p>
373
+
374
+
375
+
376
+ <div class="method-source-code" id="reset-21-source">
377
+ <pre><span class="ruby-comment"># File lib/bigbench/fragment.rb, line 113</span>
378
+ <span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">reset!</span>
379
+ <span class="ruby-ivar">@benchmark</span> = <span class="ruby-keyword">nil</span>
380
+ <span class="ruby-ivar">@fragments</span> = []
381
+ <span class="ruby-keyword">end</span></pre>
382
+ </div><!-- reset-21-source -->
383
+
384
+ </div>
385
+
386
+
387
+
388
+
389
+ </div><!-- reset-21-method -->
390
+
391
+
392
+ </section><!-- public-class-method-details -->
393
+
394
+ </section><!-- 5Buntitled-5D -->
395
+
396
+ </div><!-- documentation -->
397
+
398
+
399
+ <footer id="validator-badges">
400
+ <p><a href="http://validator.w3.org/check/referer">[Validate]</a>
401
+ <p>Generated by <a href="https://github.com/rdoc/rdoc">RDoc</a> 3.12.
402
+ <p>Generated with the <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish Rdoc Generator</a> 3.
403
+ </footer>
404
+
@@ -0,0 +1,384 @@
1
+ <!DOCTYPE html>
2
+
3
+ <html>
4
+ <head>
5
+ <meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
6
+
7
+ <title>class BigBench::Fragment::Fragment - 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="class">
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/fragment.rb
51
+ </ul>
52
+ </nav>
53
+
54
+
55
+ </div>
56
+
57
+ <div id="class-metadata">
58
+
59
+ <nav id="parent-class-section" class="section">
60
+ <h3 class="section-header">Parent</h3>
61
+
62
+ <p class="link"><a href="../../Object.html">Object</a>
63
+
64
+ </nav>
65
+
66
+
67
+ <!-- Method Quickref -->
68
+ <nav id="method-list-section" class="section">
69
+ <h3 class="section-header">Methods</h3>
70
+
71
+ <ul class="link-list">
72
+
73
+ <li><a href="#method-c-new">::new</a>
74
+
75
+ <li><a href="#method-i-run-21">#run!</a>
76
+
77
+ <li><a href="#method-i-track-21">#track!</a>
78
+
79
+ </ul>
80
+ </nav>
81
+
82
+ </div>
83
+
84
+ <div id="project-metadata">
85
+ <nav id="fileindex-section" class="section project-section">
86
+ <h3 class="section-header">Pages</h3>
87
+
88
+ <ul>
89
+
90
+ <li class="file"><a href="../../Gemfile.html">Gemfile</a>
91
+
92
+ <li class="file"><a href="../../Rakefile.html">Rakefile</a>
93
+
94
+ <li class="file"><a href="../../lib/bigbench/help/executor_txt.html">executor</a>
95
+
96
+ </ul>
97
+ </nav>
98
+
99
+ <nav id="classindex-section" class="section project-section">
100
+ <h3 class="section-header">Class and Module Index</h3>
101
+
102
+ <ul class="link-list">
103
+
104
+ <li><a href="../../BigBench.html">BigBench</a>
105
+
106
+ <li><a href="../../BigBench/Benchmark.html">BigBench::Benchmark</a>
107
+
108
+ <li><a href="../../BigBench/Benchmark/Benchmark.html">BigBench::Benchmark::Benchmark</a>
109
+
110
+ <li><a href="../../BigBench/Bot.html">BigBench::Bot</a>
111
+
112
+ <li><a href="../../BigBench/Configuration.html">BigBench::Configuration</a>
113
+
114
+ <li><a href="../../BigBench/Configuration/Config.html">BigBench::Configuration::Config</a>
115
+
116
+ <li><a href="../../BigBench/Configuration/InvalidOptions.html">BigBench::Configuration::InvalidOptions</a>
117
+
118
+ <li><a href="../../BigBench/Executor.html">BigBench::Executor</a>
119
+
120
+ <li><a href="../../BigBench/Executor/InvalidCommand.html">BigBench::Executor::InvalidCommand</a>
121
+
122
+ <li><a href="../../BigBench/Fragment.html">BigBench::Fragment</a>
123
+
124
+ <li><a href="../../BigBench/Fragment/Fragment.html">BigBench::Fragment::Fragment</a>
125
+
126
+ <li><a href="../../BigBench/Output.html">BigBench::Output</a>
127
+
128
+ <li><a href="../../BigBench/Runner.html">BigBench::Runner</a>
129
+
130
+ <li><a href="../../BigBench/Runner/NoBenchmarksDefined.html">BigBench::Runner::NoBenchmarksDefined</a>
131
+
132
+ <li><a href="../../BigBench/Store.html">BigBench::Store</a>
133
+
134
+ <li><a href="../../BigBench/Tracker.html">BigBench::Tracker</a>
135
+
136
+ <li><a href="../../BigBench/Tracker/Tracker.html">BigBench::Tracker::Tracker</a>
137
+
138
+ <li><a href="../../Float.html">Float</a>
139
+
140
+ <li><a href="../../Helpers.html">Helpers</a>
141
+
142
+ <li><a href="../../Object.html">Object</a>
143
+
144
+ <li><a href="../../TestWebServer.html">TestWebServer</a>
145
+
146
+ </ul>
147
+ </nav>
148
+
149
+ </div>
150
+ </nav>
151
+
152
+ <div id="documentation">
153
+ <h1 class="class">class BigBench::Fragment::Fragment</h1>
154
+
155
+ <div id="description" class="description">
156
+
157
+ </div><!-- description -->
158
+
159
+
160
+
161
+
162
+ <section id="5Buntitled-5D" class="documentation-section">
163
+
164
+
165
+
166
+
167
+
168
+
169
+
170
+ <!-- Attributes -->
171
+ <section id="attribute-method-details" class="method-section section">
172
+ <h3 class="section-header">Attributes</h3>
173
+
174
+
175
+ <div id="attribute-i-benchmark" class="method-detail">
176
+ <div class="method-heading attribute-method-heading">
177
+ <span class="method-name">benchmark</span><span
178
+ class="attribute-access-type">[RW]</span>
179
+ </div>
180
+
181
+ <div class="method-description">
182
+
183
+
184
+
185
+ </div>
186
+ </div>
187
+
188
+ <div id="attribute-i-method" class="method-detail">
189
+ <div class="method-heading attribute-method-heading">
190
+ <span class="method-name">method</span><span
191
+ class="attribute-access-type">[RW]</span>
192
+ </div>
193
+
194
+ <div class="method-description">
195
+
196
+
197
+
198
+ </div>
199
+ </div>
200
+
201
+ <div id="attribute-i-params" class="method-detail">
202
+ <div class="method-heading attribute-method-heading">
203
+ <span class="method-name">params</span><span
204
+ class="attribute-access-type">[RW]</span>
205
+ </div>
206
+
207
+ <div class="method-description">
208
+
209
+
210
+
211
+ </div>
212
+ </div>
213
+
214
+ <div id="attribute-i-path" class="method-detail">
215
+ <div class="method-heading attribute-method-heading">
216
+ <span class="method-name">path</span><span
217
+ class="attribute-access-type">[RW]</span>
218
+ </div>
219
+
220
+ <div class="method-description">
221
+
222
+
223
+
224
+ </div>
225
+ </div>
226
+
227
+ <div id="attribute-i-uri" class="method-detail">
228
+ <div class="method-heading attribute-method-heading">
229
+ <span class="method-name">uri</span><span
230
+ class="attribute-access-type">[RW]</span>
231
+ </div>
232
+
233
+ <div class="method-description">
234
+
235
+
236
+
237
+ </div>
238
+ </div>
239
+
240
+ </section><!-- attribute-method-details -->
241
+
242
+
243
+ <!-- Methods -->
244
+
245
+ <section id="public-class-5Buntitled-5D-method-details" class="method-section section">
246
+ <h3 class="section-header">Public Class Methods</h3>
247
+
248
+
249
+ <div id="method-c-new" class="method-detail ">
250
+
251
+ <div class="method-heading">
252
+ <span class="method-name">new</span><span
253
+ class="method-args">(benchmark, path, method, params = {})</span>
254
+ <span class="method-click-advice">click to toggle source</span>
255
+ </div>
256
+
257
+
258
+ <div class="method-description">
259
+
260
+
261
+
262
+
263
+
264
+ <div class="method-source-code" id="new-source">
265
+ <pre><span class="ruby-comment"># File lib/bigbench/fragment.rb, line 30</span>
266
+ <span class="ruby-keyword">def</span> <span class="ruby-identifier">initialize</span> <span class="ruby-identifier">benchmark</span>, <span class="ruby-identifier">path</span>, <span class="ruby-identifier">method</span>, <span class="ruby-identifier">params</span> = {}
267
+ <span class="ruby-ivar">@benchmark</span>, <span class="ruby-ivar">@path</span>, <span class="ruby-ivar">@method</span>, <span class="ruby-ivar">@params</span> = <span class="ruby-identifier">benchmark</span>, <span class="ruby-identifier">path</span>, <span class="ruby-identifier">method</span>, <span class="ruby-identifier">params</span>
268
+ <span class="ruby-ivar">@uri</span> = <span class="ruby-constant">URI</span>(<span class="ruby-ivar">@benchmark</span>.<span class="ruby-identifier">uri</span>.<span class="ruby-identifier">to_s</span> <span class="ruby-operator">+</span> <span class="ruby-ivar">@path</span>)
269
+ <span class="ruby-keyword">end</span></pre>
270
+ </div><!-- new-source -->
271
+
272
+ </div>
273
+
274
+
275
+
276
+
277
+ </div><!-- new-method -->
278
+
279
+
280
+ </section><!-- public-class-method-details -->
281
+
282
+ <section id="public-instance-5Buntitled-5D-method-details" class="method-section section">
283
+ <h3 class="section-header">Public Instance Methods</h3>
284
+
285
+
286
+ <div id="method-i-run-21" class="method-detail ">
287
+
288
+ <div class="method-heading">
289
+ <span class="method-name">run!</span><span
290
+ class="method-args">(http)</span>
291
+ <span class="method-click-advice">click to toggle source</span>
292
+ </div>
293
+
294
+
295
+ <div class="method-description">
296
+
297
+ <p>Initiates the request in the context of a <code>Net::HTTP.start</code>
298
+ block</p>
299
+
300
+
301
+
302
+ <div class="method-source-code" id="run-21-source">
303
+ <pre><span class="ruby-comment"># File lib/bigbench/fragment.rb, line 36</span>
304
+ <span class="ruby-keyword">def</span> <span class="ruby-identifier">run!</span>(<span class="ruby-identifier">http</span>)
305
+ <span class="ruby-identifier">request</span> = <span class="ruby-keyword">case</span> <span class="ruby-ivar">@method</span>
306
+ <span class="ruby-keyword">when</span> <span class="ruby-value">:get</span> <span class="ruby-keyword">then</span> <span class="ruby-constant">Net</span><span class="ruby-operator">::</span><span class="ruby-constant">HTTP</span><span class="ruby-operator">::</span><span class="ruby-constant">Get</span>.<span class="ruby-identifier">new</span>(<span class="ruby-ivar">@uri</span>.<span class="ruby-identifier">request_uri</span>)
307
+ <span class="ruby-keyword">when</span> <span class="ruby-value">:post</span> <span class="ruby-keyword">then</span> <span class="ruby-constant">Net</span><span class="ruby-operator">::</span><span class="ruby-constant">HTTP</span><span class="ruby-operator">::</span><span class="ruby-constant">Post</span>.<span class="ruby-identifier">new</span>(<span class="ruby-ivar">@uri</span>.<span class="ruby-identifier">request_uri</span>)
308
+ <span class="ruby-keyword">when</span> <span class="ruby-value">:put</span> <span class="ruby-keyword">then</span> <span class="ruby-constant">Net</span><span class="ruby-operator">::</span><span class="ruby-constant">HTTP</span><span class="ruby-operator">::</span><span class="ruby-constant">Put</span>.<span class="ruby-identifier">new</span>(<span class="ruby-ivar">@uri</span>.<span class="ruby-identifier">request_uri</span>)
309
+ <span class="ruby-keyword">when</span> <span class="ruby-value">:delete</span> <span class="ruby-keyword">then</span> <span class="ruby-constant">Net</span><span class="ruby-operator">::</span><span class="ruby-constant">HTTP</span><span class="ruby-operator">::</span><span class="ruby-constant">Delete</span>.<span class="ruby-identifier">new</span>(<span class="ruby-ivar">@uri</span>.<span class="ruby-identifier">request_uri</span>)
310
+ <span class="ruby-keyword">else</span> <span class="ruby-keyword">nil</span>
311
+ <span class="ruby-keyword">end</span>
312
+
313
+ <span class="ruby-identifier">start</span> = <span class="ruby-constant">Time</span>.<span class="ruby-identifier">now</span>
314
+ <span class="ruby-identifier">response</span> = <span class="ruby-identifier">http</span>.<span class="ruby-identifier">request</span>(<span class="ruby-identifier">request</span>)
315
+ <span class="ruby-identifier">stop</span> = <span class="ruby-constant">Time</span>.<span class="ruby-identifier">now</span>
316
+
317
+ <span class="ruby-identifier">track!</span>(<span class="ruby-identifier">start</span>, <span class="ruby-identifier">stop</span>, <span class="ruby-identifier">response</span>)
318
+ <span class="ruby-identifier">response</span>
319
+ <span class="ruby-keyword">end</span></pre>
320
+ </div><!-- run-21-source -->
321
+
322
+ </div>
323
+
324
+
325
+
326
+
327
+ </div><!-- run-21-method -->
328
+
329
+
330
+ <div id="method-i-track-21" class="method-detail ">
331
+
332
+ <div class="method-heading">
333
+ <span class="method-name">track!</span><span
334
+ class="method-args">(start, stop, response)</span>
335
+ <span class="method-click-advice">click to toggle source</span>
336
+ </div>
337
+
338
+
339
+ <div class="method-description">
340
+
341
+ <p>Adds the current tracking result as a hash to the benchmark’s tracker</p>
342
+
343
+
344
+
345
+ <div class="method-source-code" id="track-21-source">
346
+ <pre><span class="ruby-comment"># File lib/bigbench/fragment.rb, line 54</span>
347
+ <span class="ruby-keyword">def</span> <span class="ruby-identifier">track!</span>(<span class="ruby-identifier">start</span>, <span class="ruby-identifier">stop</span>, <span class="ruby-identifier">response</span>)
348
+ <span class="ruby-ivar">@benchmark</span>.<span class="ruby-identifier">tracker</span>.<span class="ruby-identifier">track</span>(
349
+ {
350
+ <span class="ruby-value">:elapsed</span> =<span class="ruby-operator">&gt;</span> (<span class="ruby-identifier">stop</span> <span class="ruby-operator">-</span> <span class="ruby-identifier">benchmark</span>.<span class="ruby-identifier">start</span>).<span class="ruby-identifier">to_f</span>,
351
+ <span class="ruby-value">:start</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">start</span>.<span class="ruby-identifier">to_f</span>,
352
+ <span class="ruby-value">:stop</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">stop</span>.<span class="ruby-identifier">to_f</span>,
353
+ <span class="ruby-value">:duration</span> =<span class="ruby-operator">&gt;</span> (<span class="ruby-identifier">stop</span> <span class="ruby-operator">-</span> <span class="ruby-identifier">start</span>).<span class="ruby-identifier">to_milliseconds</span>,
354
+ <span class="ruby-value">:benchmark</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-ivar">@benchmark</span>.<span class="ruby-identifier">name</span>,
355
+ <span class="ruby-value">:url</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-ivar">@uri</span>.<span class="ruby-identifier">to_s</span>,
356
+ <span class="ruby-value">:path</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-ivar">@uri</span>.<span class="ruby-identifier">request_uri</span>,
357
+ <span class="ruby-value">:method</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-ivar">@method</span>,
358
+ <span class="ruby-value">:status</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">response</span>.<span class="ruby-identifier">code</span>
359
+ }
360
+ )
361
+ <span class="ruby-keyword">end</span></pre>
362
+ </div><!-- track-21-source -->
363
+
364
+ </div>
365
+
366
+
367
+
368
+
369
+ </div><!-- track-21-method -->
370
+
371
+
372
+ </section><!-- public-instance-method-details -->
373
+
374
+ </section><!-- 5Buntitled-5D -->
375
+
376
+ </div><!-- documentation -->
377
+
378
+
379
+ <footer id="validator-badges">
380
+ <p><a href="http://validator.w3.org/check/referer">[Validate]</a>
381
+ <p>Generated by <a href="https://github.com/rdoc/rdoc">RDoc</a> 3.12.
382
+ <p>Generated with the <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish Rdoc Generator</a> 3.
383
+ </footer>
384
+