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.
Files changed (52) hide show
  1. data/README.textile +60 -22
  2. data/Rakefile +7 -0
  3. data/bigbench.gemspec +5 -0
  4. data/dev/net_http.rb +78 -0
  5. data/dev/test.rb +13 -0
  6. data/dev/tracking.rb +49 -0
  7. data/doc/BigBench.html +22 -17
  8. data/doc/BigBench/Benchmark.html +12 -8
  9. data/doc/BigBench/Benchmark/Benchmark.html +17 -27
  10. data/doc/BigBench/Benchmark/Looper.html +340 -0
  11. data/doc/BigBench/Bot.html +4 -2
  12. data/doc/BigBench/Configuration.html +20 -11
  13. data/doc/BigBench/Configuration/Config.html +23 -8
  14. data/doc/BigBench/Configuration/InvalidOptions.html +5 -3
  15. data/doc/BigBench/Executor.html +4 -2
  16. data/doc/BigBench/Executor/InvalidCommand.html +4 -2
  17. data/doc/BigBench/Fragment.html +46 -29
  18. data/doc/BigBench/Fragment/Fragment.html +18 -28
  19. data/doc/BigBench/Output.html +4 -2
  20. data/doc/BigBench/Runner.html +12 -9
  21. data/doc/BigBench/Runner/NoBenchmarksDefined.html +4 -2
  22. data/doc/BigBench/Store.html +4 -2
  23. data/doc/BigBench/Tracker.html +4 -2
  24. data/doc/BigBench/Tracker/Tracker.html +5 -3
  25. data/doc/EventMachineLoop.html +296 -0
  26. data/doc/Float.html +4 -2
  27. data/doc/Gemfile.html +4 -2
  28. data/doc/Helpers.html +4 -2
  29. data/doc/Object.html +87 -2
  30. data/doc/Rakefile.html +10 -3
  31. data/doc/created.rid +36 -31
  32. data/doc/index.html +4 -2
  33. data/doc/js/search_index.js +1 -1
  34. data/doc/lib/bigbench/help/executor_txt.html +4 -2
  35. data/doc/table_of_contents.html +31 -16
  36. data/lib/bigbench.rb +3 -0
  37. data/lib/bigbench/benchmark.rb +11 -21
  38. data/lib/bigbench/benchmark/looper.rb +43 -0
  39. data/lib/bigbench/configuration.rb +17 -10
  40. data/lib/bigbench/fragment.rb +47 -34
  41. data/lib/bigbench/runner.rb +8 -7
  42. data/lib/bigbench/tracker.rb +3 -3
  43. data/lib/bigbench/version.rb +1 -1
  44. data/spec/benchmark_spec.rb +14 -7
  45. data/spec/configure_spec.rb +3 -3
  46. data/spec/fragment_spec.rb +186 -24
  47. data/spec/helpers.rb +2 -4
  48. data/spec/lib/test_web_server.rb +44 -15
  49. data/spec/looper_spec.rb +47 -0
  50. data/spec/tests/local.rb +1 -1
  51. data/spec/webserver_spec.rb +91 -21
  52. metadata +77 -15
@@ -47,6 +47,7 @@
47
47
  <nav id="file-list-section" class="section">
48
48
  <h3 class="section-header">Defined In</h3>
49
49
  <ul>
50
+ <li>lib/bigbench/benchmark/looper.rb
50
51
  <li>lib/bigbench/benchmark.rb
51
52
  </ul>
52
53
  </nav>
@@ -103,6 +104,8 @@
103
104
 
104
105
  <li><a href="../BigBench/Benchmark/Benchmark.html">BigBench::Benchmark::Benchmark</a>
105
106
 
107
+ <li><a href="../BigBench/Benchmark/Looper.html">BigBench::Benchmark::Looper</a>
108
+
106
109
  <li><a href="../BigBench/Bot.html">BigBench::Bot</a>
107
110
 
108
111
  <li><a href="../BigBench/Configuration.html">BigBench::Configuration</a>
@@ -131,14 +134,14 @@
131
134
 
132
135
  <li><a href="../BigBench/Tracker/Tracker.html">BigBench::Tracker::Tracker</a>
133
136
 
137
+ <li><a href="../EventMachineLoop.html">EventMachineLoop</a>
138
+
134
139
  <li><a href="../Float.html">Float</a>
135
140
 
136
141
  <li><a href="../Helpers.html">Helpers</a>
137
142
 
138
143
  <li><a href="../Object.html">Object</a>
139
144
 
140
- <li><a href="../TestWebServer.html">TestWebServer</a>
141
-
142
145
  </ul>
143
146
  </nav>
144
147
 
@@ -158,11 +161,12 @@ multiple benchmarks like this:</p>
158
161
  <span class="ruby-identifier">get</span> <span class="ruby-string">&quot;/&quot;</span>
159
162
  <span class="ruby-identifier">get</span> <span class="ruby-string">&quot;/blog&quot;</span>
160
163
  <span class="ruby-identifier">get</span> <span class="ruby-string">&quot;/imprint&quot;</span>
164
+ <span class="ruby-identifier">get</span> <span class="ruby-string">&quot;/admin&quot;</span>, :<span class="ruby-identifier">basic_auth</span> =<span class="ruby-operator">&gt;</span> [<span class="ruby-string">'admin'</span>, <span class="ruby-string">'secret'</span>]
161
165
  <span class="ruby-keyword">end</span>
162
166
 
163
167
  <span class="ruby-identifier">benchmark</span> <span class="ruby-string">&quot;login and logout&quot;</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-string">&quot;http://localhost:3000&quot;</span> <span class="ruby-keyword">do</span>
164
- <span class="ruby-identifier">post</span> <span class="ruby-string">&quot;/login&quot;</span>, { :<span class="ruby-identifier">name</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-string">&quot;test@user.com&quot;</span>, :<span class="ruby-identifier">password</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-string">&quot;secret&quot;</span> }
165
- <span class="ruby-identifier">post</span> <span class="ruby-string">&quot;/logout&quot;</span>
168
+ <span class="ruby-identifier">post</span> <span class="ruby-string">&quot;/login&quot;</span>, :<span class="ruby-identifier">params</span> =<span class="ruby-operator">&gt;</span> { :<span class="ruby-identifier">name</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-string">&quot;test@user.com&quot;</span>, :<span class="ruby-identifier">password</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-string">&quot;secret&quot;</span> }
169
+ <span class="ruby-identifier">post</span> <span class="ruby-string">&quot;/logout&quot;</span>, :<span class="ruby-identifier">params</span> =<span class="ruby-operator">&gt;</span> { :<span class="ruby-identifier">name</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-string">&quot;test@user.com&quot;</span> }
166
170
  <span class="ruby-keyword">end</span>
167
171
  </pre>
168
172
 
@@ -206,7 +210,7 @@ retrieved with the <code>all</code> method.</p>
206
210
 
207
211
 
208
212
  <div class="method-source-code" id="add-source">
209
- <pre><span class="ruby-comment"># File lib/bigbench/benchmark.rb, line 74</span>
213
+ <pre><span class="ruby-comment"># File lib/bigbench/benchmark.rb, line 63</span>
210
214
  <span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">add</span>(<span class="ruby-identifier">options</span>, &amp;<span class="ruby-identifier">block</span>)
211
215
  <span class="ruby-identifier">name</span>, <span class="ruby-identifier">url</span> = <span class="ruby-identifier">options</span>.<span class="ruby-identifier">select</span>{ <span class="ruby-operator">|</span><span class="ruby-identifier">key</span>, <span class="ruby-identifier">value</span><span class="ruby-operator">|</span> <span class="ruby-keyword">true</span> <span class="ruby-keyword">unless</span> <span class="ruby-identifier">key</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">Symbol</span>) }.<span class="ruby-identifier">first</span>
212
216
  <span class="ruby-identifier">benchmark</span> = <span class="ruby-constant">Benchmark</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">name</span>, <span class="ruby-identifier">url</span>, <span class="ruby-identifier">options</span>, &amp;<span class="ruby-identifier">block</span>)
@@ -239,7 +243,7 @@ retrieved with the <code>all</code> method.</p>
239
243
 
240
244
 
241
245
  <div class="method-source-code" id="all-source">
242
- <pre><span class="ruby-comment"># File lib/bigbench/benchmark.rb, line 82</span>
246
+ <pre><span class="ruby-comment"># File lib/bigbench/benchmark.rb, line 71</span>
243
247
  <span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">all</span>
244
248
  <span class="ruby-ivar">@benchmarks</span>
245
249
  <span class="ruby-keyword">end</span></pre>
@@ -269,7 +273,7 @@ retrieved with the <code>all</code> method.</p>
269
273
 
270
274
 
271
275
  <div class="method-source-code" id="max_duration-source">
272
- <pre><span class="ruby-comment"># File lib/bigbench/benchmark.rb, line 92</span>
276
+ <pre><span class="ruby-comment"># File lib/bigbench/benchmark.rb, line 81</span>
273
277
  <span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">max_duration</span>
274
278
  <span class="ruby-identifier">all</span>.<span class="ruby-identifier">map</span>{ <span class="ruby-operator">|</span><span class="ruby-identifier">benchmark</span><span class="ruby-operator">|</span> <span class="ruby-identifier">benchmark</span>.<span class="ruby-identifier">duration</span> }.<span class="ruby-identifier">max</span>
275
279
  <span class="ruby-keyword">end</span></pre>
@@ -299,7 +303,7 @@ retrieved with the <code>all</code> method.</p>
299
303
 
300
304
 
301
305
  <div class="method-source-code" id="reset-21-source">
302
- <pre><span class="ruby-comment"># File lib/bigbench/benchmark.rb, line 87</span>
306
+ <pre><span class="ruby-comment"># File lib/bigbench/benchmark.rb, line 76</span>
303
307
  <span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">reset!</span>
304
308
  <span class="ruby-ivar">@benchmarks</span> = []
305
309
  <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
 
@@ -250,9 +252,9 @@
250
252
  </div>
251
253
  </div>
252
254
 
253
- <div id="attribute-i-threads" class="method-detail">
255
+ <div id="attribute-i-tracker" class="method-detail">
254
256
  <div class="method-heading attribute-method-heading">
255
- <span class="method-name">threads</span><span
257
+ <span class="method-name">tracker</span><span
256
258
  class="attribute-access-type">[RW]</span>
257
259
  </div>
258
260
 
@@ -263,9 +265,9 @@
263
265
  </div>
264
266
  </div>
265
267
 
266
- <div id="attribute-i-tracker" class="method-detail">
268
+ <div id="attribute-i-uri" class="method-detail">
267
269
  <div class="method-heading attribute-method-heading">
268
- <span class="method-name">tracker</span><span
270
+ <span class="method-name">uri</span><span
269
271
  class="attribute-access-type">[RW]</span>
270
272
  </div>
271
273
 
@@ -276,9 +278,9 @@
276
278
  </div>
277
279
  </div>
278
280
 
279
- <div id="attribute-i-uri" class="method-detail">
281
+ <div id="attribute-i-users" class="method-detail">
280
282
  <div class="method-heading attribute-method-heading">
281
- <span class="method-name">uri</span><span
283
+ <span class="method-name">users</span><span
282
284
  class="attribute-access-type">[RW]</span>
283
285
  </div>
284
286
 
@@ -314,10 +316,10 @@
314
316
 
315
317
 
316
318
  <div class="method-source-code" id="new-source">
317
- <pre><span class="ruby-comment"># File lib/bigbench/benchmark.rb, line 35</span>
319
+ <pre><span class="ruby-comment"># File lib/bigbench/benchmark.rb, line 36</span>
318
320
  <span class="ruby-keyword">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">name</span>, <span class="ruby-identifier">url</span>, <span class="ruby-identifier">options</span>, &amp;<span class="ruby-identifier">block</span>)
319
321
  <span class="ruby-ivar">@name</span>, <span class="ruby-ivar">@uri</span>, <span class="ruby-ivar">@tracker</span>, <span class="ruby-ivar">@is_running</span>, <span class="ruby-ivar">@runs</span> = <span class="ruby-identifier">name</span>, <span class="ruby-constant">URI</span>(<span class="ruby-identifier">url</span>), <span class="ruby-constant">Tracker</span><span class="ruby-operator">::</span><span class="ruby-constant">Tracker</span>.<span class="ruby-identifier">new</span>, <span class="ruby-keyword">false</span>, <span class="ruby-value">0</span>
320
- <span class="ruby-ivar">@threads</span> = <span class="ruby-identifier">options</span>[<span class="ruby-value">:threads</span>] <span class="ruby-operator">||</span> <span class="ruby-constant">BigBench</span>.<span class="ruby-identifier">config</span>.<span class="ruby-identifier">threads</span>
322
+ <span class="ruby-ivar">@users</span> = <span class="ruby-identifier">options</span>[<span class="ruby-value">:users</span>] <span class="ruby-operator">||</span> <span class="ruby-constant">BigBench</span>.<span class="ruby-identifier">config</span>.<span class="ruby-identifier">users</span>
321
323
  <span class="ruby-ivar">@duration</span> = <span class="ruby-identifier">options</span>[<span class="ruby-value">:duration</span>] <span class="ruby-operator">||</span> <span class="ruby-constant">BigBench</span>.<span class="ruby-identifier">config</span>.<span class="ruby-identifier">duration</span>
322
324
  <span class="ruby-ivar">@fragments</span> = <span class="ruby-constant">BigBench</span><span class="ruby-operator">::</span><span class="ruby-constant">Fragment</span>.<span class="ruby-identifier">parse</span>(<span class="ruby-keyword">self</span>, &amp;<span class="ruby-identifier">block</span>)
323
325
  <span class="ruby-keyword">end</span></pre>
@@ -353,7 +355,7 @@
353
355
 
354
356
 
355
357
  <div class="method-source-code" id="is_running-3F-source">
356
- <pre><span class="ruby-comment"># File lib/bigbench/benchmark.rb, line 67</span>
358
+ <pre><span class="ruby-comment"># File lib/bigbench/benchmark.rb, line 56</span>
357
359
  <span class="ruby-keyword">def</span> <span class="ruby-identifier">is_running?</span>
358
360
  <span class="ruby-ivar">@is_running</span>
359
361
  <span class="ruby-keyword">end</span></pre>
@@ -383,27 +385,15 @@
383
385
 
384
386
 
385
387
  <div class="method-source-code" id="run-21-source">
386
- <pre><span class="ruby-comment"># File lib/bigbench/benchmark.rb, line 43</span>
388
+ <pre><span class="ruby-comment"># File lib/bigbench/benchmark.rb, line 44</span>
387
389
  <span class="ruby-keyword">def</span> <span class="ruby-identifier">run!</span>
388
390
 
389
- <span class="ruby-comment"># Setup timer</span>
391
+ <span class="ruby-comment"># Setup Timer</span>
390
392
  <span class="ruby-identifier">timer</span> = <span class="ruby-constant">Thread</span>.<span class="ruby-identifier">new</span>{ <span class="ruby-identifier">sleep</span>(<span class="ruby-ivar">@duration</span>); <span class="ruby-ivar">@is_running</span> = <span class="ruby-keyword">false</span> }
391
393
  <span class="ruby-ivar">@start</span>, <span class="ruby-ivar">@is_running</span> = <span class="ruby-constant">Time</span>.<span class="ruby-identifier">now</span>, <span class="ruby-keyword">true</span>
392
394
 
393
- <span class="ruby-comment"># Benchmark loop</span>
394
- <span class="ruby-ivar">@running_threads</span> = []
395
- <span class="ruby-ivar">@threads</span>.<span class="ruby-identifier">times</span> <span class="ruby-keyword">do</span>
396
- <span class="ruby-ivar">@running_threads</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-constant">Thread</span>.<span class="ruby-identifier">new</span> <span class="ruby-keyword">do</span>
397
- <span class="ruby-keyword">while</span> <span class="ruby-identifier">is_running?</span> <span class="ruby-keyword">do</span>
398
- <span class="ruby-constant">Net</span><span class="ruby-operator">::</span><span class="ruby-constant">HTTP</span>.<span class="ruby-identifier">start</span>(<span class="ruby-identifier">uri</span>.<span class="ruby-identifier">host</span>, <span class="ruby-identifier">uri</span>.<span class="ruby-identifier">port</span>) <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">http</span><span class="ruby-operator">|</span>
399
- <span class="ruby-ivar">@fragments</span>.<span class="ruby-identifier">each</span>{ <span class="ruby-operator">|</span><span class="ruby-identifier">fragment</span><span class="ruby-operator">|</span> <span class="ruby-identifier">fragment</span>.<span class="ruby-identifier">run!</span>(<span class="ruby-identifier">http</span>) }
400
- <span class="ruby-keyword">end</span>
401
- <span class="ruby-keyword">end</span>
402
- <span class="ruby-keyword">end</span>
403
- <span class="ruby-keyword">end</span>
404
-
405
- <span class="ruby-comment"># Stop execution</span>
406
- <span class="ruby-ivar">@running_threads</span>.<span class="ruby-identifier">each</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">thread</span><span class="ruby-operator">|</span> <span class="ruby-identifier">thread</span>.<span class="ruby-identifier">join</span> }
395
+ <span class="ruby-comment"># Loop Requests</span>
396
+ <span class="ruby-ivar">@users</span>.<span class="ruby-identifier">times</span> { <span class="ruby-constant">Looper</span>.<span class="ruby-identifier">new</span>(<span class="ruby-keyword">self</span>).<span class="ruby-identifier">loop!</span> }
407
397
  <span class="ruby-ivar">@runs</span> <span class="ruby-operator">+=</span> <span class="ruby-value">1</span>
408
398
  <span class="ruby-keyword">end</span></pre>
409
399
  </div><!-- run-21-source -->
@@ -0,0 +1,340 @@
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::Benchmark::Looper - 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/benchmark/looper.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-loop-21">#loop!</a>
76
+
77
+ <li><a href="#method-i-next_fragment">#next_fragment</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/Benchmark/Looper.html">BigBench::Benchmark::Looper</a>
111
+
112
+ <li><a href="../../BigBench/Bot.html">BigBench::Bot</a>
113
+
114
+ <li><a href="../../BigBench/Configuration.html">BigBench::Configuration</a>
115
+
116
+ <li><a href="../../BigBench/Configuration/Config.html">BigBench::Configuration::Config</a>
117
+
118
+ <li><a href="../../BigBench/Configuration/InvalidOptions.html">BigBench::Configuration::InvalidOptions</a>
119
+
120
+ <li><a href="../../BigBench/Executor.html">BigBench::Executor</a>
121
+
122
+ <li><a href="../../BigBench/Executor/InvalidCommand.html">BigBench::Executor::InvalidCommand</a>
123
+
124
+ <li><a href="../../BigBench/Fragment.html">BigBench::Fragment</a>
125
+
126
+ <li><a href="../../BigBench/Fragment/Fragment.html">BigBench::Fragment::Fragment</a>
127
+
128
+ <li><a href="../../BigBench/Output.html">BigBench::Output</a>
129
+
130
+ <li><a href="../../BigBench/Runner.html">BigBench::Runner</a>
131
+
132
+ <li><a href="../../BigBench/Runner/NoBenchmarksDefined.html">BigBench::Runner::NoBenchmarksDefined</a>
133
+
134
+ <li><a href="../../BigBench/Store.html">BigBench::Store</a>
135
+
136
+ <li><a href="../../BigBench/Tracker.html">BigBench::Tracker</a>
137
+
138
+ <li><a href="../../BigBench/Tracker/Tracker.html">BigBench::Tracker::Tracker</a>
139
+
140
+ <li><a href="../../EventMachineLoop.html">EventMachineLoop</a>
141
+
142
+ <li><a href="../../Float.html">Float</a>
143
+
144
+ <li><a href="../../Helpers.html">Helpers</a>
145
+
146
+ <li><a href="../../Object.html">Object</a>
147
+
148
+ </ul>
149
+ </nav>
150
+
151
+ </div>
152
+ </nav>
153
+
154
+ <div id="documentation">
155
+ <h1 class="class">class BigBench::Benchmark::Looper</h1>
156
+
157
+ <div id="description" class="description">
158
+
159
+ </div><!-- description -->
160
+
161
+
162
+
163
+
164
+ <section id="5Buntitled-5D" class="documentation-section">
165
+
166
+
167
+
168
+
169
+
170
+
171
+
172
+ <!-- Attributes -->
173
+ <section id="attribute-method-details" class="method-section section">
174
+ <h3 class="section-header">Attributes</h3>
175
+
176
+
177
+ <div id="attribute-i-benchmark" class="method-detail">
178
+ <div class="method-heading attribute-method-heading">
179
+ <span class="method-name">benchmark</span><span
180
+ class="attribute-access-type">[RW]</span>
181
+ </div>
182
+
183
+ <div class="method-description">
184
+
185
+
186
+
187
+ </div>
188
+ </div>
189
+
190
+ <div id="attribute-i-loops" class="method-detail">
191
+ <div class="method-heading attribute-method-heading">
192
+ <span class="method-name">loops</span><span
193
+ class="attribute-access-type">[RW]</span>
194
+ </div>
195
+
196
+ <div class="method-description">
197
+
198
+
199
+
200
+ </div>
201
+ </div>
202
+
203
+ </section><!-- attribute-method-details -->
204
+
205
+
206
+ <!-- Methods -->
207
+
208
+ <section id="public-class-5Buntitled-5D-method-details" class="method-section section">
209
+ <h3 class="section-header">Public Class Methods</h3>
210
+
211
+
212
+ <div id="method-c-new" class="method-detail ">
213
+
214
+ <div class="method-heading">
215
+ <span class="method-name">new</span><span
216
+ class="method-args">(benchmark)</span>
217
+ <span class="method-click-advice">click to toggle source</span>
218
+ </div>
219
+
220
+
221
+ <div class="method-description">
222
+
223
+
224
+
225
+
226
+
227
+ <div class="method-source-code" id="new-source">
228
+ <pre><span class="ruby-comment"># File lib/bigbench/benchmark/looper.rb, line 9</span>
229
+ <span class="ruby-keyword">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">benchmark</span>)
230
+ <span class="ruby-ivar">@benchmark</span>, <span class="ruby-ivar">@loops</span> = <span class="ruby-identifier">benchmark</span>, <span class="ruby-value">0</span>
231
+ <span class="ruby-ivar">@fragments</span> = <span class="ruby-constant">Fiber</span>.<span class="ruby-identifier">new</span> { <span class="ruby-ivar">@benchmark</span>.<span class="ruby-identifier">fragments</span>.<span class="ruby-identifier">cycle</span>{ <span class="ruby-operator">|</span><span class="ruby-identifier">fragment</span><span class="ruby-operator">|</span> <span class="ruby-constant">Fiber</span>.<span class="ruby-identifier">yield</span>(<span class="ruby-identifier">fragment</span>) } }
232
+ <span class="ruby-keyword">end</span></pre>
233
+ </div><!-- new-source -->
234
+
235
+ </div>
236
+
237
+
238
+
239
+
240
+ </div><!-- new-method -->
241
+
242
+
243
+ </section><!-- public-class-method-details -->
244
+
245
+ <section id="public-instance-5Buntitled-5D-method-details" class="method-section section">
246
+ <h3 class="section-header">Public Instance Methods</h3>
247
+
248
+
249
+ <div id="method-i-loop-21" class="method-detail ">
250
+
251
+ <div class="method-heading">
252
+ <span class="method-name">loop!</span><span
253
+ class="method-args">()</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="loop-21-source">
265
+ <pre><span class="ruby-comment"># File lib/bigbench/benchmark/looper.rb, line 14</span>
266
+ <span class="ruby-keyword">def</span> <span class="ruby-identifier">loop!</span>
267
+ <span class="ruby-keyword">return</span> <span class="ruby-keyword">unless</span> <span class="ruby-ivar">@benchmark</span>.<span class="ruby-identifier">is_running?</span>
268
+ <span class="ruby-ivar">@loops</span> <span class="ruby-operator">+=</span> <span class="ruby-value">1</span>
269
+
270
+ <span class="ruby-comment"># Start next fragment</span>
271
+ <span class="ruby-identifier">fragment</span> = <span class="ruby-identifier">next_fragment</span>
272
+ <span class="ruby-identifier">start</span> = <span class="ruby-constant">Time</span>.<span class="ruby-identifier">now</span>
273
+ <span class="ruby-identifier">http</span> = <span class="ruby-identifier">fragment</span>.<span class="ruby-identifier">run!</span>
274
+
275
+ <span class="ruby-comment"># Success</span>
276
+ <span class="ruby-identifier">http</span>.<span class="ruby-identifier">callback</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">http</span><span class="ruby-operator">|</span>
277
+ <span class="ruby-identifier">fragment</span>.<span class="ruby-identifier">track!</span>(<span class="ruby-identifier">start</span>, <span class="ruby-constant">Time</span>.<span class="ruby-identifier">now</span>, <span class="ruby-identifier">http</span>)
278
+ <span class="ruby-identifier">loop!</span>
279
+ <span class="ruby-keyword">end</span>
280
+
281
+ <span class="ruby-comment"># Error</span>
282
+ <span class="ruby-identifier">http</span>.<span class="ruby-identifier">errback</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">http</span><span class="ruby-operator">|</span>
283
+ <span class="ruby-identifier">fragment</span>.<span class="ruby-identifier">track!</span>(<span class="ruby-identifier">start</span>, <span class="ruby-constant">Time</span>.<span class="ruby-identifier">now</span>, <span class="ruby-identifier">http</span>)
284
+ <span class="ruby-identifier">loop!</span>
285
+ <span class="ruby-keyword">end</span>
286
+
287
+ <span class="ruby-keyword">end</span></pre>
288
+ </div><!-- loop-21-source -->
289
+
290
+ </div>
291
+
292
+
293
+
294
+
295
+ </div><!-- loop-21-method -->
296
+
297
+
298
+ <div id="method-i-next_fragment" class="method-detail ">
299
+
300
+ <div class="method-heading">
301
+ <span class="method-name">next_fragment</span><span
302
+ class="method-args">()</span>
303
+ <span class="method-click-advice">click to toggle source</span>
304
+ </div>
305
+
306
+
307
+ <div class="method-description">
308
+
309
+
310
+
311
+
312
+
313
+ <div class="method-source-code" id="next_fragment-source">
314
+ <pre><span class="ruby-comment"># File lib/bigbench/benchmark/looper.rb, line 37</span>
315
+ <span class="ruby-keyword">def</span> <span class="ruby-identifier">next_fragment</span>
316
+ <span class="ruby-ivar">@fragments</span>.<span class="ruby-identifier">resume</span>
317
+ <span class="ruby-keyword">end</span></pre>
318
+ </div><!-- next_fragment-source -->
319
+
320
+ </div>
321
+
322
+
323
+
324
+
325
+ </div><!-- next_fragment-method -->
326
+
327
+
328
+ </section><!-- public-instance-method-details -->
329
+
330
+ </section><!-- 5Buntitled-5D -->
331
+
332
+ </div><!-- documentation -->
333
+
334
+
335
+ <footer id="validator-badges">
336
+ <p><a href="http://validator.w3.org/check/referer">[Validate]</a>
337
+ <p>Generated by <a href="https://github.com/rdoc/rdoc">RDoc</a> 3.12.
338
+ <p>Generated with the <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish Rdoc Generator</a> 3.
339
+ </footer>
340
+