doc/BigBench/Benchmark/Benchmark.html in bigbench-0.0.1 vs doc/BigBench/Benchmark/Benchmark.html in bigbench-0.0.2

- old
+ new

@@ -105,10 +105,12 @@ <li><a href="../../BigBench/Benchmark.html">BigBench::Benchmark</a> <li><a href="../../BigBench/Benchmark/Benchmark.html">BigBench::Benchmark::Benchmark</a> + <li><a href="../../BigBench/Benchmark/Looper.html">BigBench::Benchmark::Looper</a> + <li><a href="../../BigBench/Bot.html">BigBench::Bot</a> <li><a href="../../BigBench/Configuration.html">BigBench::Configuration</a> <li><a href="../../BigBench/Configuration/Config.html">BigBench::Configuration::Config</a> @@ -133,18 +135,18 @@ <li><a href="../../BigBench/Tracker.html">BigBench::Tracker</a> <li><a href="../../BigBench/Tracker/Tracker.html">BigBench::Tracker::Tracker</a> + <li><a href="../../EventMachineLoop.html">EventMachineLoop</a> + <li><a href="../../Float.html">Float</a> <li><a href="../../Helpers.html">Helpers</a> <li><a href="../../Object.html">Object</a> - <li><a href="../../TestWebServer.html">TestWebServer</a> - </ul> </nav> </div> </nav> @@ -248,39 +250,39 @@ </div> </div> - <div id="attribute-i-threads" class="method-detail"> + <div id="attribute-i-tracker" class="method-detail"> <div class="method-heading attribute-method-heading"> - <span class="method-name">threads</span><span + <span class="method-name">tracker</span><span class="attribute-access-type">[RW]</span> </div> <div class="method-description"> </div> </div> - <div id="attribute-i-tracker" class="method-detail"> + <div id="attribute-i-uri" class="method-detail"> <div class="method-heading attribute-method-heading"> - <span class="method-name">tracker</span><span + <span class="method-name">uri</span><span class="attribute-access-type">[RW]</span> </div> <div class="method-description"> </div> </div> - <div id="attribute-i-uri" class="method-detail"> + <div id="attribute-i-users" class="method-detail"> <div class="method-heading attribute-method-heading"> - <span class="method-name">uri</span><span + <span class="method-name">users</span><span class="attribute-access-type">[RW]</span> </div> <div class="method-description"> @@ -312,14 +314,14 @@ <p>Initizalizes a new benchmark</p> <div class="method-source-code" id="new-source"> - <pre><span class="ruby-comment"># File lib/bigbench/benchmark.rb, line 35</span> + <pre><span class="ruby-comment"># File lib/bigbench/benchmark.rb, line 36</span> <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>) <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> - <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> + <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> <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> <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>) <span class="ruby-keyword">end</span></pre> </div><!-- new-source --> @@ -351,11 +353,11 @@ <p>Returns if this benchmark is currently running</p> <div class="method-source-code" id="is_running-3F-source"> - <pre><span class="ruby-comment"># File lib/bigbench/benchmark.rb, line 67</span> + <pre><span class="ruby-comment"># File lib/bigbench/benchmark.rb, line 56</span> <span class="ruby-keyword">def</span> <span class="ruby-identifier">is_running?</span> <span class="ruby-ivar">@is_running</span> <span class="ruby-keyword">end</span></pre> </div><!-- is_running-3F-source --> @@ -381,30 +383,18 @@ <p>Execute this benchmark</p> <div class="method-source-code" id="run-21-source"> - <pre><span class="ruby-comment"># File lib/bigbench/benchmark.rb, line 43</span> + <pre><span class="ruby-comment"># File lib/bigbench/benchmark.rb, line 44</span> <span class="ruby-keyword">def</span> <span class="ruby-identifier">run!</span> - <span class="ruby-comment"># Setup timer</span> + <span class="ruby-comment"># Setup Timer</span> <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> } <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> - <span class="ruby-comment"># Benchmark loop</span> - <span class="ruby-ivar">@running_threads</span> = [] - <span class="ruby-ivar">@threads</span>.<span class="ruby-identifier">times</span> <span class="ruby-keyword">do</span> - <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> - <span class="ruby-keyword">while</span> <span class="ruby-identifier">is_running?</span> <span class="ruby-keyword">do</span> - <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> - <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>) } - <span class="ruby-keyword">end</span> - <span class="ruby-keyword">end</span> - <span class="ruby-keyword">end</span> - <span class="ruby-keyword">end</span> - - <span class="ruby-comment"># Stop execution</span> - <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> } + <span class="ruby-comment"># Loop Requests</span> + <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> } <span class="ruby-ivar">@runs</span> <span class="ruby-operator">+=</span> <span class="ruby-value">1</span> <span class="ruby-keyword">end</span></pre> </div><!-- run-21-source --> </div>