bigbench 0.0.3 → 0.0.4
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/.DS_Store +0 -0
- data/README.textile +254 -4
- data/Rakefile +43 -9
- data/doc/Array.html +288 -0
- data/doc/BigBench.html +32 -6
- data/doc/BigBench/Benchmark.html +24 -0
- data/doc/BigBench/Benchmark/Benchmark.html +24 -0
- data/doc/BigBench/Benchmark/Looper.html +24 -0
- data/doc/BigBench/Bot.html +24 -0
- data/doc/BigBench/Configuration.html +24 -0
- data/doc/BigBench/Configuration/Config.html +24 -0
- data/doc/BigBench/Configuration/InvalidOptions.html +24 -0
- data/doc/BigBench/Executor.html +33 -3
- data/doc/BigBench/Executor/InvalidCommand.html +25 -1
- data/doc/BigBench/Fragment.html +24 -0
- data/doc/BigBench/Fragment/Fragment.html +24 -0
- data/doc/BigBench/Output.html +24 -0
- data/doc/BigBench/PostProcessor.html +33 -6
- data/doc/BigBench/PostProcessor/Environment.html +489 -2
- data/doc/BigBench/PostProcessor/Environment/Appearings.html +327 -0
- data/doc/BigBench/PostProcessor/Environment/AttributeCluster.html +275 -0
- data/doc/BigBench/PostProcessor/Environment/BenchmarkNotFound.html +293 -0
- data/doc/BigBench/PostProcessor/Environment/Cluster.html +387 -0
- data/doc/BigBench/PostProcessor/Environment/NormalDistribution.html +383 -0
- data/doc/BigBench/PostProcessor/Environment/PolynomialRegression.html +438 -0
- data/doc/BigBench/PostProcessor/Environment/Statistics.html +568 -0
- data/doc/BigBench/PostProcessor/Graphs.html +270 -0
- data/doc/BigBench/PostProcessor/Graphs/LineGraph.html +403 -0
- data/doc/BigBench/PostProcessor/Graphs/PieGraph.html +396 -0
- data/doc/BigBench/PostProcessor/InvalidProcessor.html +25 -1
- data/doc/BigBench/PostProcessor/Processor.html +59 -7
- data/doc/BigBench/PostProcessor/Statistics.html +26 -2
- data/doc/BigBench/PostProcessor/Test.html +26 -2
- data/doc/BigBench/Runner.html +24 -0
- data/doc/BigBench/Runner/NoBenchmarksDefined.html +24 -0
- data/doc/BigBench/Store.html +24 -0
- data/doc/BigBench/Tracker.html +24 -0
- data/doc/BigBench/Tracker/Tracker.html +24 -0
- data/doc/EventMachineLoop.html +24 -0
- data/doc/Float.html +24 -0
- data/doc/Gemfile.html +24 -0
- data/doc/Helpers.html +78 -0
- data/doc/Object.html +29 -0
- data/doc/README_rdoc.html +803 -0
- data/doc/Rakefile.html +66 -10
- data/doc/created.rid +46 -40
- data/doc/index.html +667 -1
- data/doc/js/search_index.js +1 -1
- data/doc/lib/bigbench/help/executor_txt.html +32 -2
- data/doc/rdoc.css +4 -0
- data/doc/table_of_contents.html +179 -23
- data/doc/test_rdoc.html +159 -0
- data/lib/bigbench.rb +2 -0
- data/lib/bigbench/executor.rb +17 -1
- data/lib/bigbench/help/executor.txt +5 -0
- data/lib/bigbench/post_processor.rb +16 -32
- data/lib/bigbench/post_processor/environment.rb +525 -0
- data/lib/bigbench/post_processor/graphs.rb +209 -0
- data/lib/bigbench/post_processor/statistics.rb +29 -49
- data/lib/bigbench/version.rb +1 -1
- data/spec/executor_spec.rb +35 -0
- data/spec/helpers.rb +15 -1
- data/spec/post_processor_spec.rb +19 -4
- data/spec/post_processors/environment_spec.rb +412 -0
- data/spec/post_processors/graphs_spec.rb +23 -0
- data/spec/post_processors/statistics_spec.rb +3 -2
- data/spec/tests/local.rb +1 -1
- data/spec/tests/sample_results_big.ljson +51925 -0
- data/spec/tests/sample_results_small.ljson +3875 -0
- data/spec/tests/with_post_processor.ljson +43 -0
- data/spec/tests/with_post_processor.rb +12 -0
- data/spec/tmp/.DS_Store +0 -0
- data/spec/tracker_spec.rb +8 -8
- metadata +61 -101
data/doc/Rakefile.html
CHANGED
@@ -51,6 +51,8 @@
|
|
51
51
|
|
52
52
|
<li class="file"><a href="./Gemfile.html">Gemfile</a>
|
53
53
|
|
54
|
+
<li class="file"><a href="./README_rdoc.html">README</a>
|
55
|
+
|
54
56
|
<li class="file"><a href="./Rakefile.html">Rakefile</a>
|
55
57
|
|
56
58
|
<li class="file"><a href="./lib/bigbench/help/executor_txt.html">executor</a>
|
@@ -93,6 +95,26 @@
|
|
93
95
|
|
94
96
|
<li><a href="./BigBench/PostProcessor/Environment.html">BigBench::PostProcessor::Environment</a>
|
95
97
|
|
98
|
+
<li><a href="./BigBench/PostProcessor/Environment/Appearings.html">BigBench::PostProcessor::Environment::Appearings</a>
|
99
|
+
|
100
|
+
<li><a href="./BigBench/PostProcessor/Environment/AttributeCluster.html">BigBench::PostProcessor::Environment::AttributeCluster</a>
|
101
|
+
|
102
|
+
<li><a href="./BigBench/PostProcessor/Environment/BenchmarkNotFound.html">BigBench::PostProcessor::Environment::BenchmarkNotFound</a>
|
103
|
+
|
104
|
+
<li><a href="./BigBench/PostProcessor/Environment/Cluster.html">BigBench::PostProcessor::Environment::Cluster</a>
|
105
|
+
|
106
|
+
<li><a href="./BigBench/PostProcessor/Environment/NormalDistribution.html">BigBench::PostProcessor::Environment::NormalDistribution</a>
|
107
|
+
|
108
|
+
<li><a href="./BigBench/PostProcessor/Environment/PolynomialRegression.html">BigBench::PostProcessor::Environment::PolynomialRegression</a>
|
109
|
+
|
110
|
+
<li><a href="./BigBench/PostProcessor/Environment/Statistics.html">BigBench::PostProcessor::Environment::Statistics</a>
|
111
|
+
|
112
|
+
<li><a href="./BigBench/PostProcessor/Graphs.html">BigBench::PostProcessor::Graphs</a>
|
113
|
+
|
114
|
+
<li><a href="./BigBench/PostProcessor/Graphs/LineGraph.html">BigBench::PostProcessor::Graphs::LineGraph</a>
|
115
|
+
|
116
|
+
<li><a href="./BigBench/PostProcessor/Graphs/PieGraph.html">BigBench::PostProcessor::Graphs::PieGraph</a>
|
117
|
+
|
96
118
|
<li><a href="./BigBench/PostProcessor/InvalidProcessor.html">BigBench::PostProcessor::InvalidProcessor</a>
|
97
119
|
|
98
120
|
<li><a href="./BigBench/PostProcessor/Processor.html">BigBench::PostProcessor::Processor</a>
|
@@ -111,6 +133,8 @@
|
|
111
133
|
|
112
134
|
<li><a href="./BigBench/Tracker/Tracker.html">BigBench::Tracker::Tracker</a>
|
113
135
|
|
136
|
+
<li><a href="./Array.html">Array</a>
|
137
|
+
|
114
138
|
<li><a href="./EventMachineLoop.html">EventMachineLoop</a>
|
115
139
|
|
116
140
|
<li><a href="./Float.html">Float</a>
|
@@ -127,20 +151,52 @@
|
|
127
151
|
|
128
152
|
<div id="documentation" class="description">
|
129
153
|
|
130
|
-
<p>require “bundler/gem_tasks” require “rack
|
154
|
+
<p>require “bundler/gem_tasks” require “rack” require “RedCloth” require
|
155
|
+
“redcloth-formatters-rdoc” require “rdoc/task”</p>
|
131
156
|
|
132
|
-
<p>
|
157
|
+
<p>desc “Create and open documentation” task :doc do</p>
|
133
158
|
|
134
|
-
<pre class="ruby"><span class="ruby-
|
135
|
-
<span class="ruby-identifier">
|
136
|
-
|
137
|
-
<span class="ruby-
|
159
|
+
<pre class="ruby"><span class="ruby-comment"># Compile the readme to the rdoc format</span>
|
160
|
+
<span class="ruby-identifier">readme_textile</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">open</span>(<span class="ruby-string">'README.textile'</span>, <span class="ruby-string">'r+'</span>){ <span class="ruby-operator">|</span><span class="ruby-identifier">file</span><span class="ruby-operator">|</span> <span class="ruby-identifier">file</span>.<span class="ruby-identifier">read</span> }
|
161
|
+
<span class="ruby-identifier">readme_rdoc</span> = <span class="ruby-constant">RedCloth</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">readme_textile</span>).<span class="ruby-identifier">to_rdoc</span>
|
162
|
+
<span class="ruby-constant">File</span>.<span class="ruby-identifier">open</span>(<span class="ruby-string">'README.rdoc'</span>, <span class="ruby-string">'w+'</span>){ <span class="ruby-operator">|</span><span class="ruby-identifier">file</span><span class="ruby-operator">|</span> <span class="ruby-identifier">file</span>.<span class="ruby-identifier">write</span>(<span class="ruby-identifier">readme_rdoc</span>) }
|
138
163
|
|
139
|
-
<span class="ruby-
|
140
|
-
<span class="ruby-
|
141
|
-
|
142
|
-
|
164
|
+
<span class="ruby-comment"># Create rdoc with the readme as main file</span>
|
165
|
+
<span class="ruby-value">%xrdoc --main README.rdoc --include lib/bigbench/help/`</span>
|
166
|
+
|
167
|
+
<span class="ruby-constant">RDoc</span><span class="ruby-operator">::</span><span class="ruby-constant">Task</span>.<span class="ruby-identifier">new</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">rdoc</span><span class="ruby-operator">|</span>
|
168
|
+
<span class="ruby-identifier">rdoc</span>.<span class="ruby-identifier">main</span> = <span class="ruby-string">"README.rdoc"</span>
|
169
|
+
<span class="ruby-identifier">rdoc</span>.<span class="ruby-identifier">rdoc_files</span>.<span class="ruby-identifier">include</span>(<span class="ruby-string">"README.rdoc"</span>, <span class="ruby-string">"lib/bigbench/help/"</span>)
|
143
170
|
<span class="ruby-keyword">end</span>
|
171
|
+
|
172
|
+
<span class="ruby-comment"># Fix RDocs inability to handle tables</span>
|
173
|
+
<span class="ruby-identifier">index_html</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">open</span>(<span class="ruby-string">'doc/index.html'</span>, <span class="ruby-string">'r+'</span>){ <span class="ruby-operator">|</span><span class="ruby-identifier">file</span><span class="ruby-operator">|</span> <span class="ruby-identifier">file</span>.<span class="ruby-identifier">read</span> }
|
174
|
+
<span class="ruby-identifier">index_html</span>.<span class="ruby-identifier">gsub!</span> <span class="ruby-string">'&lt;'</span>, <span class="ruby-string">'<'</span>
|
175
|
+
<span class="ruby-identifier">index_html</span>.<span class="ruby-identifier">gsub!</span> <span class="ruby-string">'&gt;'</span>, <span class="ruby-string">'>'</span>
|
176
|
+
<span class="ruby-identifier">index_html</span>.<span class="ruby-identifier">gsub!</span> <span class="ruby-string">'<p><table></p>'</span>, <span class="ruby-string">'<table>'</span>
|
177
|
+
<span class="ruby-identifier">index_html</span>.<span class="ruby-identifier">gsub!</span> <span class="ruby-string">'<pre><tr>'</span>, <span class="ruby-string">'<tr>'</span>
|
178
|
+
<span class="ruby-identifier">index_html</span>.<span class="ruby-identifier">gsub!</span> <span class="ruby-string">'</tr></pre>'</span>, <span class="ruby-string">'</tr>'</span>
|
179
|
+
<span class="ruby-identifier">index_html</span>.<span class="ruby-identifier">gsub!</span> <span class="ruby-string">'<p></table></p>'</span>, <span class="ruby-string">'</table>'</span>
|
180
|
+
<span class="ruby-constant">File</span>.<span class="ruby-identifier">open</span>(<span class="ruby-string">'doc/index.html'</span>, <span class="ruby-string">'w+'</span>){ <span class="ruby-operator">|</span><span class="ruby-identifier">file</span><span class="ruby-operator">|</span> <span class="ruby-identifier">file</span>.<span class="ruby-identifier">write</span>(<span class="ruby-identifier">index_html</span>) }
|
181
|
+
|
182
|
+
<span class="ruby-comment"># Add table style</span>
|
183
|
+
<span class="ruby-identifier">rdoc_css</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">open</span>(<span class="ruby-string">'doc/rdoc.css'</span>, <span class="ruby-string">'r+'</span>){ <span class="ruby-operator">|</span><span class="ruby-identifier">file</span><span class="ruby-operator">|</span> <span class="ruby-identifier">file</span>.<span class="ruby-identifier">read</span> }
|
184
|
+
<span class="ruby-identifier">rdoc_css</span> <span class="ruby-operator">+=</span> <span class="ruby-node">"\n table{ border: 1px dashed #D3D3D3; line-height: 30px; margin-top: 10px; border-collapse: collapse; }"</span>
|
185
|
+
<span class="ruby-identifier">rdoc_css</span> <span class="ruby-operator">+=</span> <span class="ruby-node">"\n td{ padding-left:20px; padding-right:20px; border-top: 1px solid #E4E4E4; }"</span>
|
186
|
+
<span class="ruby-identifier">rdoc_css</span> <span class="ruby-operator">+=</span> <span class="ruby-string">"\n th{ padding-left:20px; padding-right:20px; text-align:left; }"</span>
|
187
|
+
<span class="ruby-constant">File</span>.<span class="ruby-identifier">open</span>(<span class="ruby-string">'doc/rdoc.css'</span>, <span class="ruby-string">'w+'</span>){ <span class="ruby-operator">|</span><span class="ruby-identifier">file</span><span class="ruby-operator">|</span> <span class="ruby-identifier">file</span>.<span class="ruby-identifier">write</span>(<span class="ruby-identifier">rdoc_css</span>) }
|
188
|
+
|
189
|
+
<span class="ruby-comment"># Clean up the rdoc file</span>
|
190
|
+
<span class="ruby-constant">File</span>.<span class="ruby-identifier">delete</span>(<span class="ruby-string">"README.rdoc"</span>)
|
191
|
+
<span class="ruby-value">%xopen doc/index.html`</span>
|
192
|
+
</pre>
|
193
|
+
|
194
|
+
<p>end</p>
|
195
|
+
|
196
|
+
<p>desc “Start Thin RDoc Testserver” task :server do</p>
|
197
|
+
|
198
|
+
<pre class="ruby"><span class="ruby-identifier">load</span> <span class="ruby-string">"spec/lib/test_web_server.rb"</span>
|
199
|
+
<span class="ruby-constant">Rack</span><span class="ruby-operator">::</span><span class="ruby-constant">Handler</span><span class="ruby-operator">::</span><span class="ruby-constant">Thin</span>.<span class="ruby-identifier">run</span> <span class="ruby-constant">Sinatra</span><span class="ruby-operator">::</span><span class="ruby-constant">Application</span>, :<span class="ruby-constant">Port</span> =<span class="ruby-operator">></span> <span class="ruby-value">3001</span>
|
144
200
|
</pre>
|
145
201
|
|
146
202
|
<p>end</p>
|
data/doc/created.rid
CHANGED
@@ -1,40 +1,46 @@
|
|
1
|
-
|
2
|
-
./bin/bigbench
|
3
|
-
./dev/net_http.rb
|
4
|
-
./dev/test.rb
|
5
|
-
./dev/tracking.rb
|
6
|
-
./Gemfile
|
7
|
-
./lib/bigbench/benchmark/looper.rb
|
8
|
-
./lib/bigbench/benchmark.rb
|
9
|
-
./lib/bigbench/bot.rb
|
10
|
-
./lib/bigbench/configuration.rb
|
11
|
-
./lib/bigbench/executor.rb
|
12
|
-
./lib/bigbench/float_extensions.rb
|
13
|
-
./lib/bigbench/fragment.rb
|
14
|
-
./lib/bigbench/help/executor.txt
|
15
|
-
./lib/bigbench/initializers.rb
|
16
|
-
./lib/bigbench/output.rb
|
17
|
-
./lib/bigbench/post_processor/
|
18
|
-
./lib/bigbench/post_processor.rb
|
19
|
-
./lib/bigbench/
|
20
|
-
./lib/bigbench/
|
21
|
-
./lib/bigbench/
|
22
|
-
./lib/bigbench/
|
23
|
-
./lib/bigbench.rb
|
24
|
-
./
|
25
|
-
./
|
26
|
-
./
|
27
|
-
./
|
28
|
-
./spec/
|
29
|
-
./spec/
|
30
|
-
./spec/
|
31
|
-
./spec/
|
32
|
-
./spec/
|
33
|
-
./spec/
|
34
|
-
./spec/
|
35
|
-
./spec/
|
36
|
-
./spec/
|
37
|
-
./spec/
|
38
|
-
./spec/
|
39
|
-
./spec/
|
40
|
-
./spec/
|
1
|
+
Sat, 28 Apr 2012 16:48:35 +0200
|
2
|
+
./bin/bigbench Sat, 21 Apr 2012 16:57:55 +0200
|
3
|
+
./dev/net_http.rb Sat, 21 Apr 2012 16:57:55 +0200
|
4
|
+
./dev/test.rb Sat, 21 Apr 2012 16:57:55 +0200
|
5
|
+
./dev/tracking.rb Sat, 21 Apr 2012 16:57:55 +0200
|
6
|
+
./Gemfile Sat, 21 Apr 2012 16:57:55 +0200
|
7
|
+
./lib/bigbench/benchmark/looper.rb Sat, 21 Apr 2012 16:57:55 +0200
|
8
|
+
./lib/bigbench/benchmark.rb Sat, 21 Apr 2012 16:57:55 +0200
|
9
|
+
./lib/bigbench/bot.rb Sat, 21 Apr 2012 16:57:55 +0200
|
10
|
+
./lib/bigbench/configuration.rb Sat, 21 Apr 2012 16:57:55 +0200
|
11
|
+
./lib/bigbench/executor.rb Sat, 28 Apr 2012 16:14:18 +0200
|
12
|
+
./lib/bigbench/float_extensions.rb Sat, 21 Apr 2012 16:57:55 +0200
|
13
|
+
./lib/bigbench/fragment.rb Sat, 21 Apr 2012 16:57:55 +0200
|
14
|
+
./lib/bigbench/help/executor.txt Sat, 21 Apr 2012 16:57:55 +0200
|
15
|
+
./lib/bigbench/initializers.rb Sat, 21 Apr 2012 16:57:55 +0200
|
16
|
+
./lib/bigbench/output.rb Sat, 21 Apr 2012 16:57:55 +0200
|
17
|
+
./lib/bigbench/post_processor/environment.rb Sat, 28 Apr 2012 15:52:51 +0200
|
18
|
+
./lib/bigbench/post_processor/graphs.rb Fri, 27 Apr 2012 04:13:00 +0200
|
19
|
+
./lib/bigbench/post_processor/statistics.rb Fri, 27 Apr 2012 05:58:34 +0200
|
20
|
+
./lib/bigbench/post_processor.rb Sat, 28 Apr 2012 16:35:04 +0200
|
21
|
+
./lib/bigbench/runner.rb Sat, 21 Apr 2012 16:57:55 +0200
|
22
|
+
./lib/bigbench/store.rb Sat, 21 Apr 2012 16:57:55 +0200
|
23
|
+
./lib/bigbench/tracker.rb Sat, 21 Apr 2012 16:57:55 +0200
|
24
|
+
./lib/bigbench/version.rb Sat, 21 Apr 2012 16:57:55 +0200
|
25
|
+
./lib/bigbench.rb Sat, 28 Apr 2012 16:04:25 +0200
|
26
|
+
./Rakefile Sat, 28 Apr 2012 16:43:58 +0200
|
27
|
+
./README.rdoc Sat, 28 Apr 2012 16:48:35 +0200
|
28
|
+
./spec/benchmark_spec.rb Sat, 21 Apr 2012 16:57:55 +0200
|
29
|
+
./spec/bot_spec.rb Sat, 21 Apr 2012 16:57:55 +0200
|
30
|
+
./spec/configure_spec.rb Sat, 21 Apr 2012 16:57:55 +0200
|
31
|
+
./spec/executor_spec.rb Sat, 21 Apr 2012 16:57:55 +0200
|
32
|
+
./spec/fragment_spec.rb Sat, 21 Apr 2012 16:57:55 +0200
|
33
|
+
./spec/helpers.rb Sat, 21 Apr 2012 16:57:55 +0200
|
34
|
+
./spec/lib/test_web_server.rb Sat, 21 Apr 2012 16:57:55 +0200
|
35
|
+
./spec/looper_spec.rb Sat, 21 Apr 2012 16:57:55 +0200
|
36
|
+
./spec/post_processor_spec.rb Sat, 21 Apr 2012 16:57:55 +0200
|
37
|
+
./spec/post_processors/environment_spec.rb Sat, 28 Apr 2012 16:04:45 +0200
|
38
|
+
./spec/post_processors/graphs_spec.rb Fri, 27 Apr 2012 05:06:24 +0200
|
39
|
+
./spec/post_processors/statistics_spec.rb Fri, 27 Apr 2012 05:59:02 +0200
|
40
|
+
./spec/runner_spec.rb Sat, 21 Apr 2012 16:57:55 +0200
|
41
|
+
./spec/store_spec.rb Sat, 21 Apr 2012 16:57:55 +0200
|
42
|
+
./spec/tests/local.rb Fri, 27 Apr 2012 04:21:33 +0200
|
43
|
+
./spec/tests/local_invalid.rb Sat, 21 Apr 2012 16:57:55 +0200
|
44
|
+
./spec/tests/with_post_processor.rb Fri, 27 Apr 2012 06:03:27 +0200
|
45
|
+
./spec/tracker_spec.rb Fri, 27 Apr 2012 04:23:22 +0200
|
46
|
+
./spec/webserver_spec.rb Sat, 21 Apr 2012 16:57:56 +0200
|
data/doc/index.html
CHANGED
@@ -51,6 +51,8 @@
|
|
51
51
|
|
52
52
|
<li class="file"><a href="./Gemfile.html">Gemfile</a>
|
53
53
|
|
54
|
+
<li class="file"><a href="./README_rdoc.html">README</a>
|
55
|
+
|
54
56
|
<li class="file"><a href="./Rakefile.html">Rakefile</a>
|
55
57
|
|
56
58
|
<li class="file"><a href="./lib/bigbench/help/executor_txt.html">executor</a>
|
@@ -93,6 +95,26 @@
|
|
93
95
|
|
94
96
|
<li><a href="./BigBench/PostProcessor/Environment.html">BigBench::PostProcessor::Environment</a>
|
95
97
|
|
98
|
+
<li><a href="./BigBench/PostProcessor/Environment/Appearings.html">BigBench::PostProcessor::Environment::Appearings</a>
|
99
|
+
|
100
|
+
<li><a href="./BigBench/PostProcessor/Environment/AttributeCluster.html">BigBench::PostProcessor::Environment::AttributeCluster</a>
|
101
|
+
|
102
|
+
<li><a href="./BigBench/PostProcessor/Environment/BenchmarkNotFound.html">BigBench::PostProcessor::Environment::BenchmarkNotFound</a>
|
103
|
+
|
104
|
+
<li><a href="./BigBench/PostProcessor/Environment/Cluster.html">BigBench::PostProcessor::Environment::Cluster</a>
|
105
|
+
|
106
|
+
<li><a href="./BigBench/PostProcessor/Environment/NormalDistribution.html">BigBench::PostProcessor::Environment::NormalDistribution</a>
|
107
|
+
|
108
|
+
<li><a href="./BigBench/PostProcessor/Environment/PolynomialRegression.html">BigBench::PostProcessor::Environment::PolynomialRegression</a>
|
109
|
+
|
110
|
+
<li><a href="./BigBench/PostProcessor/Environment/Statistics.html">BigBench::PostProcessor::Environment::Statistics</a>
|
111
|
+
|
112
|
+
<li><a href="./BigBench/PostProcessor/Graphs.html">BigBench::PostProcessor::Graphs</a>
|
113
|
+
|
114
|
+
<li><a href="./BigBench/PostProcessor/Graphs/LineGraph.html">BigBench::PostProcessor::Graphs::LineGraph</a>
|
115
|
+
|
116
|
+
<li><a href="./BigBench/PostProcessor/Graphs/PieGraph.html">BigBench::PostProcessor::Graphs::PieGraph</a>
|
117
|
+
|
96
118
|
<li><a href="./BigBench/PostProcessor/InvalidProcessor.html">BigBench::PostProcessor::InvalidProcessor</a>
|
97
119
|
|
98
120
|
<li><a href="./BigBench/PostProcessor/Processor.html">BigBench::PostProcessor::Processor</a>
|
@@ -111,6 +133,8 @@
|
|
111
133
|
|
112
134
|
<li><a href="./BigBench/Tracker/Tracker.html">BigBench::Tracker::Tracker</a>
|
113
135
|
|
136
|
+
<li><a href="./Array.html">Array</a>
|
137
|
+
|
114
138
|
<li><a href="./EventMachineLoop.html">EventMachineLoop</a>
|
115
139
|
|
116
140
|
<li><a href="./Float.html">Float</a>
|
@@ -125,7 +149,649 @@
|
|
125
149
|
</div>
|
126
150
|
</nav>
|
127
151
|
|
128
|
-
<
|
152
|
+
<div id="documentation" class="description">
|
153
|
+
|
154
|
+
<h1 id="label-BigBench"><a href="BigBench.html">BigBench</a></h1>
|
155
|
+
|
156
|
+
<p><a href="BigBench.html">BigBench</a> is a http penetration tool. It allows
|
157
|
+
you to test the performance of any web server with very high loads. It:</p>
|
158
|
+
<ul><li>
|
159
|
+
<p>Is a fancy ruby solution for local and remote load benchmarking</p>
|
160
|
+
</li><li>
|
161
|
+
<p>Creates about 16% more load then Apache’s JMeter</p>
|
162
|
+
</li><li>
|
163
|
+
<p>Has an own very easy to use DSL</p>
|
164
|
+
</li><li>
|
165
|
+
<p>Makes remote testing a breeze with bots</p>
|
166
|
+
</li><li>
|
167
|
+
<p>Offers an awesome post processor environment to analyze your benchmarks
|
168
|
+
that includes <code>tracking iteration</code>, <code>polynomial
|
169
|
+
regressions</code>, <code>normal distributions</code>,</p>
|
170
|
+
</li><li>
|
171
|
+
<p>Offers the ability to hook in and execute any code after the benchmarks are
|
172
|
+
finished</p>
|
173
|
+
</li><li>
|
174
|
+
<p>Comes with included post processors that create statistics and graphs</p>
|
175
|
+
</li><li>
|
176
|
+
<p>Is very easy to extend!</p>
|
177
|
+
</li></ul>
|
178
|
+
|
179
|
+
<h3 id="label-Installation">Installation</h3>
|
180
|
+
|
181
|
+
<pre>gem install bigbench</pre>
|
182
|
+
|
183
|
+
<h3 id="label-Further+Reading">Further Reading</h3>
|
184
|
+
<ul><li>
|
185
|
+
<p><a href="http://southdesign.github.com/bigbench">BigBench RDoc</a></p>
|
186
|
+
</li></ul>
|
187
|
+
|
188
|
+
<h3 id="label-Requirements">Requirements</h3>
|
189
|
+
<ul><li>
|
190
|
+
<p>Ruby 1.9+</p>
|
191
|
+
</li><li>
|
192
|
+
<p>Redisonly if you’re testing with multiple hosts</p>
|
193
|
+
</li></ul>
|
194
|
+
|
195
|
+
<h2 id="label-Test+Receipts">Test Receipts</h2>
|
196
|
+
|
197
|
+
<p>How do the test receipts look like? As easy as possible. For example like
|
198
|
+
this in <code>example.rb</code>:</p>
|
199
|
+
|
200
|
+
<pre class="ruby"><span class="ruby-identifier">configure</span> =<span class="ruby-operator">></span> {
|
201
|
+
:<span class="ruby-identifier">duration</span> =<span class="ruby-operator">></span> <span class="ruby-value">2</span>.<span class="ruby-identifier">minutes</span>,
|
202
|
+
:<span class="ruby-identifier">output</span> =<span class="ruby-operator">></span> <span class="ruby-string">"example.ljson"</span>,
|
203
|
+
:<span class="ruby-identifier">users</span> =<span class="ruby-operator">></span> <span class="ruby-value">5</span>,
|
204
|
+
:<span class="ruby-identifier">basic_auth</span> =<span class="ruby-operator">></span> [<span class="ruby-string">'username'</span>, <span class="ruby-string">'password'</span>]
|
205
|
+
}
|
206
|
+
|
207
|
+
<span class="ruby-identifier">benchmark</span> <span class="ruby-string">"default website pages"</span> =<span class="ruby-operator">></span> <span class="ruby-string">"http://localhost:3000"</span> <span class="ruby-keyword">do</span>
|
208
|
+
<span class="ruby-identifier">get</span> <span class="ruby-string">"/"</span>
|
209
|
+
<span class="ruby-identifier">get</span> <span class="ruby-string">"/blog"</span>
|
210
|
+
<span class="ruby-identifier">get</span> <span class="ruby-string">"/imprint"</span>
|
211
|
+
<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>]
|
212
|
+
<span class="ruby-keyword">end</span>
|
213
|
+
|
214
|
+
<span class="ruby-identifier">benchmark</span> <span class="ruby-string">"login and logout"</span> =<span class="ruby-operator">></span> <span class="ruby-string">"http://localhost:3000"</span> <span class="ruby-keyword">do</span>
|
215
|
+
<span class="ruby-identifier">post</span> <span class="ruby-string">"/login"</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">"test@user.com"</span>, :<span class="ruby-identifier">password</span> =<span class="ruby-operator">></span> <span class="ruby-string">"secret"</span> }
|
216
|
+
<span class="ruby-identifier">post</span> <span class="ruby-string">"/logout"</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">"test@user.com"</span> }
|
217
|
+
<span class="ruby-keyword">end</span>
|
218
|
+
|
219
|
+
<span class="ruby-identifier">post_process</span> :<span class="ruby-identifier">statistics</span>
|
220
|
+
</pre>
|
221
|
+
|
222
|
+
<h2 id="label-Single+Host+vs.+Multiple+Hosts+Testing">Single Host vs. Multiple Hosts Testing</h2>
|
223
|
+
|
224
|
+
<p>You can either test with a single machine right from your local host, or
|
225
|
+
with multiple machines using bots. No matter what, the test receipt will
|
226
|
+
stay the same.</p>
|
227
|
+
|
228
|
+
<h3 id="label-Single+Host">Single Host</h3>
|
229
|
+
|
230
|
+
<p><a href="BigBench.html">BigBench</a> allows you to run your tests against
|
231
|
+
every host from your local machine. The command for this looks like this:</p>
|
232
|
+
|
233
|
+
<pre>bigbench run local example.rb</pre>
|
234
|
+
|
235
|
+
<h3 id="label-Multiple+Hosts+with+Bots">Multiple Hosts with Bots</h3>
|
236
|
+
|
237
|
+
<p><a href="BigBench.html">BigBench</a> uses a bot design pattern which means
|
238
|
+
you can run your tests from multiple hosts. Everything you need for this is
|
239
|
+
a redis that is reachable from all testing hosts. Every host simply starts
|
240
|
+
a bot that is checking for a new test receipt every minute like this:</p>
|
241
|
+
|
242
|
+
<pre>bigbench start bot redis_url:port redis_password</pre>
|
243
|
+
|
244
|
+
<p>Then to run the tests from all hosts simply use the same receipt as you
|
245
|
+
would use for a local run and call it like this:</p>
|
246
|
+
|
247
|
+
<pre>bigbench run bots example.rb redis_url:port redis_password</pre>
|
248
|
+
|
249
|
+
<p>This will upload the test receipt to all bots and make them run it. Every
|
250
|
+
bot reports its results back to the redis and the local machine then
|
251
|
+
combines, and writes them to the output file. So you test with the same
|
252
|
+
receipts and get the same results, no matter if your testing from the local
|
253
|
+
host or with multiple bots.</p>
|
254
|
+
|
255
|
+
<p><img src="http://southdesign.github.com/bigbench/images/structure.png" /></p>
|
256
|
+
|
257
|
+
<h2 id="label-Output">Output</h2>
|
258
|
+
|
259
|
+
<p>How does the recorded output look like? It’s in the <code>*.ljson</code>
|
260
|
+
format which is nothing else but a textfile with a complete JSON object on
|
261
|
+
every line. It looks like this:</p>
|
262
|
+
|
263
|
+
<pre>{"elapsed":0.002233,"start":1333981203.542233,"stop":1333981203.54279,"duration":0,"benchmark":"index page","url":"http://localhost:3000/","path":"/","method":"get","status":"200"}
|
264
|
+
{"elapsed":0.00331,"start":1333981203.5434968,"stop":1333981203.5438669,"duration":0,"benchmark":"index page","url":"http://localhost:3000/","path":"/","method":"get","status":"200"}
|
265
|
+
{"elapsed":0.004248,"start":1333981203.544449,"stop":1333981203.544805,"duration":0,"benchmark":"index page","url":"http://localhost:3000/","path":"/","method":"get","status":"200"}
|
266
|
+
{"elapsed":0.00521,"start":1333981203.545397,"stop":1333981203.5457668,"duration":0,"benchmark":"index page","url":"http://localhost:3000/","path":"/","method":"get","status":"200"}
|
267
|
+
{"elapsed":0.00615,"start":1333981203.546355,"stop":1333981203.546707,"duration":0,"benchmark":"index page","url":"http://localhost:3000/","path":"/","method":"get","status":"200"}
|
268
|
+
{"elapsed":0.007127,"start":1333981203.547328,"stop":1333981203.5476842,"duration":0,"benchmark":"index page","url":"http://localhost:3000/","path":"/","method":"get","status":"200"}
|
269
|
+
{"elapsed":0.008024,"start":1333981203.548226,"stop":1333981203.5485811,"duration":0,"benchmark":"index page","url":"http://localhost:3000/","path":"/","method":"get","status":"200"}
|
270
|
+
{"elapsed":0.008904,"start":1333981203.549105,"stop":1333981203.549461,"duration":0,"benchmark":"index page","url":"http://localhost:3000/","path":"/","method":"get","status":"200"}
|
271
|
+
{"elapsed":0.009803,"start":1333981203.550003,"stop":1333981203.55036,"duration":0,"benchmark":"index page","url":"http://localhost:3000/","path":"/","method":"get","status":"200"}
|
272
|
+
{"elapsed":0.010678,"start":1333981203.550882,"stop":1333981203.551235,"duration":0,"benchmark":"index page","url":"http://localhost:3000/","path":"/","method":"get","status":"200"}
|
273
|
+
{"elapsed":0.011549,"start":1333981203.5517519,"stop":1333981203.552106,"duration":0,"benchmark":"index page","url":"http://localhost:3000/","path":"/","method":"get","status":"200"}
|
274
|
+
{"elapsed":0.012417,"start":1333981203.5526242,"stop":1333981203.552974,"duration":0,"benchmark":"index page","url":"http://localhost:3000/","path":"/","method":"get","status":"200"}
|
275
|
+
{"elapsed":0.013294,"start":1333981203.553495,"stop":1333981203.553851,"duration":0,"benchmark":"index page","url":"http://localhost:3000/","path":"/","method":"get","status":"200"}
|
276
|
+
{"elapsed":0.014166,"start":1333981203.5543702,"stop":1333981203.554723,"duration":0,"benchmark":"index page","url":"http://localhost:3000/","path":"/","method":"get","status":"200"}
|
277
|
+
{"elapsed":0.015043,"start":1333981203.555247,"stop":1333981203.5556,"duration":0,"benchmark":"index page","url":"http://localhost:3000/","path":"/","method":"get","status":"200"}
|
278
|
+
{"elapsed":0.01592,"start":1333981203.556119,"stop":1333981203.5564768,"duration":0,"benchmark":"index page","url":"http://localhost:3000/","path":"/","method":"get","status":"200"}
|
279
|
+
...</pre>
|
280
|
+
|
281
|
+
<p>The advantage with this file format is, that it can be parsed and computed
|
282
|
+
very efficiently because the JSON parser doesn’t have to parse a whole JSON
|
283
|
+
array with with loads of objects but simply one objectline by line.</p>
|
284
|
+
|
285
|
+
<h2 id="label-Post+Processors">Post Processors</h2>
|
286
|
+
|
287
|
+
<p>After the benchmark has finished you can create hooks and write plugins
|
288
|
+
that do something with the collected data. To setup a hook simply use the
|
289
|
+
<code>post_process</code> method to add a block or run a predefined plugin:</p>
|
290
|
+
|
291
|
+
<pre class="ruby"><span class="ruby-comment"># Run BigBench::PostProcessor::Statistics</span>
|
292
|
+
<span class="ruby-identifier">post_process</span> :<span class="ruby-identifier">statistics</span>
|
293
|
+
|
294
|
+
<span class="ruby-comment"># Run a block that could do anything</span>
|
295
|
+
<span class="ruby-identifier">post_process</span> <span class="ruby-keyword">do</span>
|
296
|
+
|
297
|
+
<span class="ruby-identifier">total_trackings</span>, <span class="ruby-identifier">total_errors</span> = <span class="ruby-value">0</span>, <span class="ruby-value">0</span>
|
298
|
+
<span class="ruby-identifier">each_tracking</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">tracking</span><span class="ruby-operator">|</span>
|
299
|
+
<span class="ruby-identifier">total_trackings</span> <span class="ruby-operator">+=</span> <span class="ruby-value">1</span>
|
300
|
+
<span class="ruby-identifier">total_errors</span> <span class="ruby-operator">+=</span> <span class="ruby-value">1</span> <span class="ruby-keyword">unless</span> <span class="ruby-identifier">tracking</span>[:<span class="ruby-identifier">status</span>] <span class="ruby-operator">==</span> <span class="ruby-value">200</span>
|
301
|
+
<span class="ruby-keyword">end</span>
|
302
|
+
|
303
|
+
<span class="ruby-constant">Twitter</span>.<span class="ruby-identifier">post</span> <span class="ruby-node">"Just run BigBench with #{total_trackings} trackings and #{total_errors} errors."</span>
|
304
|
+
|
305
|
+
<span class="ruby-keyword">end</span>
|
306
|
+
</pre>
|
307
|
+
|
308
|
+
<p>It’s very easy to write a post processor. The basic structure is like this:</p>
|
309
|
+
|
310
|
+
<pre class="ruby"><span class="ruby-keyword">module</span> <span class="ruby-constant">BigBench</span>
|
311
|
+
<span class="ruby-keyword">module</span> <span class="ruby-constant">PostProcessor</span>
|
312
|
+
<span class="ruby-keyword">module</span> <span class="ruby-constant">SamplePostProcessor</span>
|
313
|
+
|
314
|
+
<span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">run!</span>(<span class="ruby-identifier">options</span>)
|
315
|
+
<span class="ruby-comment"># Do whatever you want here</span>
|
316
|
+
<span class="ruby-keyword">end</span>
|
317
|
+
|
318
|
+
<span class="ruby-keyword">end</span>
|
319
|
+
<span class="ruby-keyword">end</span>
|
320
|
+
<span class="ruby-keyword">end</span>
|
321
|
+
</pre>
|
322
|
+
|
323
|
+
<p>You can hook it in with:</p>
|
324
|
+
|
325
|
+
<pre>post_process :sample_post_processor
|
326
|
+
# or
|
327
|
+
post_process BigBench::PostProcessor::SamplePostProcessor</pre>
|
328
|
+
|
329
|
+
<h3 id="label-Post+Processor+Environment">Post Processor Environment</h3>
|
330
|
+
|
331
|
+
<p>Post processors by default offer a great load of functionality that helps
|
332
|
+
to evaluate the benchmarks. The available methods are:</p>
|
333
|
+
|
334
|
+
<h4 id="label-each_tracking">each_tracking</h4>
|
335
|
+
|
336
|
+
<p>Iterate over each of the tracking elements. The trackings are read
|
337
|
+
line-by-line. This is the fastest approach and should be used for huge
|
338
|
+
datasets because the trackings are not loaded completely into memory.</p>
|
339
|
+
|
340
|
+
<pre class="ruby"><span class="ruby-identifier">total_trackings</span>, <span class="ruby-identifier">total_errors</span> = <span class="ruby-value">0</span>, <span class="ruby-value">0</span>
|
341
|
+
<span class="ruby-identifier">each_tracking</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">tracking</span><span class="ruby-operator">|</span>
|
342
|
+
<span class="ruby-identifier">total_trackings</span> <span class="ruby-operator">+=</span> <span class="ruby-value">1</span>
|
343
|
+
<span class="ruby-identifier">total_errors</span> <span class="ruby-operator">+=</span> <span class="ruby-value">1</span> <span class="ruby-keyword">unless</span> <span class="ruby-identifier">tracking</span>[:<span class="ruby-identifier">status</span>] <span class="ruby-operator">==</span> <span class="ruby-value">200</span>
|
344
|
+
<span class="ruby-keyword">end</span>
|
345
|
+
</pre>
|
346
|
+
|
347
|
+
<h4 id="label-trackings">trackings</h4>
|
348
|
+
|
349
|
+
<p>An array with all tracking hashes in it. The creation might take some time
|
350
|
+
at the first usage, afterwards the array is cached automatically.</p>
|
351
|
+
|
352
|
+
<pre class="ruby"><span class="ruby-identifier">trackings</span>.<span class="ruby-identifier">size</span> <span class="ruby-comment"># => 650456</span>
|
353
|
+
<span class="ruby-identifier">trackings</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">tracking</span><span class="ruby-operator">|</span>
|
354
|
+
<span class="ruby-identifier">puts</span> <span class="ruby-identifier">tracking</span>[:<span class="ruby-identifier">duration</span>]
|
355
|
+
<span class="ruby-keyword">end</span>
|
356
|
+
</pre>
|
357
|
+
|
358
|
+
<h4 id="label-statistics">statistics</h4>
|
359
|
+
|
360
|
+
<p>Computes the default statistics for any attribute</p>
|
361
|
+
|
362
|
+
<pre class="ruby"><span class="ruby-comment"># Unclustered statistics</span>
|
363
|
+
<span class="ruby-identifier">statistics</span>.<span class="ruby-identifier">durations</span>.<span class="ruby-identifier">max</span> <span class="ruby-comment"># => 78.2</span>
|
364
|
+
<span class="ruby-identifier">statistics</span>.<span class="ruby-identifier">durations</span>.<span class="ruby-identifier">min</span> <span class="ruby-comment"># => 12.3</span>
|
365
|
+
|
366
|
+
<span class="ruby-identifier">statistics</span>.<span class="ruby-identifier">durations</span>.<span class="ruby-identifier">mean</span> <span class="ruby-comment"># => 45.2</span>
|
367
|
+
<span class="ruby-identifier">statistics</span>.<span class="ruby-identifier">durations</span>.<span class="ruby-identifier">average</span> <span class="ruby-comment"># => 45.2</span>
|
368
|
+
|
369
|
+
<span class="ruby-identifier">statistics</span>.<span class="ruby-identifier">durations</span>.<span class="ruby-identifier">standard_deviation</span> <span class="ruby-comment"># => 11.3</span>
|
370
|
+
<span class="ruby-identifier">statistics</span>.<span class="ruby-identifier">durations</span>.<span class="ruby-identifier">sd</span> <span class="ruby-comment"># => 11.3</span>
|
371
|
+
|
372
|
+
<span class="ruby-identifier">statistics</span>.<span class="ruby-identifier">durations</span>.<span class="ruby-identifier">squared_deviation</span> <span class="ruby-comment"># => 60.7</span>
|
373
|
+
<span class="ruby-identifier">statistics</span>.<span class="ruby-identifier">durations</span>.<span class="ruby-identifier">variance</span> <span class="ruby-comment"># => 60.7</span>
|
374
|
+
|
375
|
+
<span class="ruby-comment"># Time clustered statistics - 1.second</span>
|
376
|
+
<span class="ruby-identifier">statistics</span>.<span class="ruby-identifier">requests</span>.<span class="ruby-identifier">max</span> <span class="ruby-comment"># => 42.1</span>
|
377
|
+
<span class="ruby-identifier">statistics</span>.<span class="ruby-identifier">requests</span>.<span class="ruby-identifier">min</span> <span class="ruby-comment"># => 12.3</span>
|
378
|
+
<span class="ruby-identifier">statistics</span>.<span class="ruby-identifier">methods</span>(:<span class="ruby-identifier">get</span>).<span class="ruby-identifier">max</span> <span class="ruby-comment"># => 42.1</span>
|
379
|
+
<span class="ruby-identifier">statistics</span>.<span class="ruby-identifier">methods</span>(:<span class="ruby-identifier">get</span>).<span class="ruby-identifier">average</span> <span class="ruby-comment"># => 33.1</span>
|
380
|
+
<span class="ruby-identifier">statistics</span>.<span class="ruby-identifier">benchmark</span>(<span class="ruby-string">"index page"</span>).<span class="ruby-identifier">average</span> <span class="ruby-comment"># => 32.9</span>
|
381
|
+
<span class="ruby-identifier">statistics</span>.<span class="ruby-identifier">paths</span>(<span class="ruby-string">"/"</span>).<span class="ruby-identifier">average</span> <span class="ruby-comment"># => 12.5</span>
|
382
|
+
</pre>
|
383
|
+
|
384
|
+
<h4 id="label-cluster">cluster</h4>
|
385
|
+
|
386
|
+
<p>Clusters the resulting trackings by a timebase. The default timebase is
|
387
|
+
<code>1.second</code> which means, that it groups all trackings to full
|
388
|
+
seconds and calculates the amount of requests and the average duration.</p>
|
389
|
+
|
390
|
+
<pre class="ruby"><span class="ruby-comment"># Duration is 120 seconds for this example</span>
|
391
|
+
|
392
|
+
<span class="ruby-comment"># 1.second</span>
|
393
|
+
<span class="ruby-identifier">cluster</span>.<span class="ruby-identifier">timesteps</span> <span class="ruby-comment"># => [1, 2, ..., 120]</span>
|
394
|
+
<span class="ruby-identifier">cluster</span>.<span class="ruby-identifier">durations</span> <span class="ruby-comment"># => [43, 96, ..., 41]</span>
|
395
|
+
<span class="ruby-identifier">cluster</span>.<span class="ruby-identifier">requests</span> <span class="ruby-comment"># => [503, 541, ..., 511]</span>
|
396
|
+
<span class="ruby-identifier">cluster</span>.<span class="ruby-identifier">methods</span>(:<span class="ruby-identifier">get</span>) <span class="ruby-comment"># => [200, 204, ..., 209]</span>
|
397
|
+
<span class="ruby-identifier">cluster</span>.<span class="ruby-identifier">methods</span>(:<span class="ruby-identifier">post</span>) <span class="ruby-comment"># => [201, 102, ..., 401]</span>
|
398
|
+
<span class="ruby-identifier">cluster</span>.<span class="ruby-identifier">statuses</span>(<span class="ruby-value">200</span>) <span class="ruby-comment"># => [501, 502, ..., 102]</span>
|
399
|
+
<span class="ruby-identifier">cluster</span>.<span class="ruby-identifier">statuses</span>(<span class="ruby-value">404</span>) <span class="ruby-comment"># => [3, 1, ..., 0]</span>
|
400
|
+
<span class="ruby-identifier">cluster</span>.<span class="ruby-identifier">paths</span>(<span class="ruby-string">"/"</span>) <span class="ruby-comment"># => [401, 482, ..., 271]</span>
|
401
|
+
<span class="ruby-identifier">cluster</span>.<span class="ruby-identifier">paths</span>(<span class="ruby-string">"/logout"</span>) <span class="ruby-comment"># => [56, 51, ..., 38]</span>
|
402
|
+
<span class="ruby-identifier">cluster</span>.<span class="ruby-identifier">benchmark</span>(<span class="ruby-string">"index"</span>) <span class="ruby-comment"># => [342, 531, ..., 234]</span>
|
403
|
+
<span class="ruby-identifier">cluster</span>.<span class="ruby-identifier">benchmark</span>(<span class="ruby-string">"user"</span>) <span class="ruby-comment"># => [22, 41, ..., 556]</span>
|
404
|
+
|
405
|
+
<span class="ruby-comment"># 1.minute</span>
|
406
|
+
<span class="ruby-identifier">cluster</span>(<span class="ruby-value">1</span>.<span class="ruby-identifier">minute</span>).<span class="ruby-identifier">timesteps</span> <span class="ruby-comment"># => [0, 1]</span>
|
407
|
+
<span class="ruby-identifier">cluster</span>(<span class="ruby-value">1</span>.<span class="ruby-identifier">minute</span>).<span class="ruby-identifier">durations</span> <span class="ruby-comment"># => [42, 44]</span>
|
408
|
+
<span class="ruby-identifier">cluster</span>(<span class="ruby-value">1</span>.<span class="ruby-identifier">minute</span>).<span class="ruby-identifier">requests</span> <span class="ruby-comment"># => [24032, 21893]</span>
|
409
|
+
<span class="ruby-identifier">cluster</span>(<span class="ruby-value">1</span>.<span class="ruby-identifier">minute</span>).<span class="ruby-identifier">methods</span>(:<span class="ruby-identifier">get</span>) <span class="ruby-comment"># => [200, 204]</span>
|
410
|
+
<span class="ruby-identifier">cluster</span>(<span class="ruby-value">1</span>.<span class="ruby-identifier">minute</span>).<span class="ruby-identifier">statuses</span>(<span class="ruby-value">200</span>) <span class="ruby-comment"># => [501, 502]</span>
|
411
|
+
<span class="ruby-identifier">cluster</span>(<span class="ruby-value">1</span>.<span class="ruby-identifier">minute</span>).<span class="ruby-identifier">paths</span>(<span class="ruby-string">"/"</span>) <span class="ruby-comment"># => [401, 482]</span>
|
412
|
+
<span class="ruby-identifier">cluster</span>(<span class="ruby-value">1</span>.<span class="ruby-identifier">minute</span>).<span class="ruby-identifier">benchmark</span>(<span class="ruby-string">"user"</span>) <span class="ruby-comment"># => [22, 41]</span>
|
413
|
+
|
414
|
+
<span class="ruby-comment"># 30.seconds</span>
|
415
|
+
<span class="ruby-identifier">cluster</span>(<span class="ruby-value">30</span>.<span class="ruby-identifier">seconds</span>).<span class="ruby-identifier">timesteps</span> <span class="ruby-comment"># => [0, 1, 2, 3]</span>
|
416
|
+
<span class="ruby-identifier">cluster</span>(<span class="ruby-value">30</span>.<span class="ruby-identifier">seconds</span>).<span class="ruby-identifier">durations</span> <span class="ruby-comment"># => [42, 44, 41, 40]</span>
|
417
|
+
<span class="ruby-identifier">cluster</span>(<span class="ruby-value">30</span>.<span class="ruby-identifier">seconds</span>).<span class="ruby-identifier">requests</span> <span class="ruby-comment"># => [11023, 10234, 12345, 13789]</span>
|
418
|
+
<span class="ruby-identifier">cluster</span>(<span class="ruby-value">30</span>.<span class="ruby-identifier">seconds</span>).<span class="ruby-identifier">methods</span>(:<span class="ruby-identifier">get</span>) <span class="ruby-comment"># => [200, 204, 34, 124]</span>
|
419
|
+
<span class="ruby-identifier">cluster</span>(<span class="ruby-value">30</span>.<span class="ruby-identifier">seconds</span>).<span class="ruby-identifier">statuses</span>(<span class="ruby-value">200</span>) <span class="ruby-comment"># => [501, 502, 243, 57]</span>
|
420
|
+
<span class="ruby-identifier">cluster</span>(<span class="ruby-value">30</span>.<span class="ruby-identifier">seconds</span>).<span class="ruby-identifier">paths</span>(<span class="ruby-string">"/"</span>) <span class="ruby-comment"># => [401, 482, 124, 234]</span>
|
421
|
+
<span class="ruby-identifier">cluster</span>(<span class="ruby-value">30</span>.<span class="ruby-identifier">seconds</span>).<span class="ruby-identifier">benchmark</span>(<span class="ruby-string">"user"</span>) <span class="ruby-comment"># => [22, 41, 12, 51]</span>
|
422
|
+
</pre>
|
423
|
+
|
424
|
+
<h4 id="label-appearing">appearing</h4>
|
425
|
+
|
426
|
+
<p>Lists the unique attribute values that appeared in all trackings or the
|
427
|
+
selected tracking scope.</p>
|
428
|
+
|
429
|
+
<pre class="ruby"><span class="ruby-identifier">appearing</span>.<span class="ruby-identifier">statuses</span> <span class="ruby-comment"># => [200, 404]</span>
|
430
|
+
<span class="ruby-identifier">appearing</span>.<span class="ruby-identifier">methods</span> <span class="ruby-comment"># => ["get", "post"]</span>
|
431
|
+
<span class="ruby-identifier">appearing</span>.<span class="ruby-identifier">paths</span> <span class="ruby-comment"># => ["/", "/basic/auth"</span>
|
432
|
+
</pre>
|
433
|
+
|
434
|
+
<h4 id="label-polynomial_regression">polynomial_regression</h4>
|
435
|
+
|
436
|
+
<p>The polynomial regression creates a function that tries to map the test
|
437
|
+
data best. With this function you have the ability do derivate and thereby
|
438
|
+
plot the changes of the tested system over time. The degree of the
|
439
|
+
regression can be freely chosen.</p>
|
440
|
+
|
441
|
+
<pre class="ruby"><span class="ruby-comment"># Linear regression by default</span>
|
442
|
+
<span class="ruby-identifier">polynomial_regression</span>.<span class="ruby-identifier">durations</span>.<span class="ruby-identifier">x</span> <span class="ruby-comment"># => [1, 2, ..., 120]</span>
|
443
|
+
<span class="ruby-identifier">polynomial_regression</span>.<span class="ruby-identifier">durations</span>.<span class="ruby-identifier">y</span> <span class="ruby-comment"># => [45, 23, ..., 36]</span>
|
444
|
+
<span class="ruby-identifier">polynomial_regression</span>.<span class="ruby-identifier">requests</span>.<span class="ruby-identifier">y</span> <span class="ruby-comment"># => [43, 45, ..., 62]</span>
|
445
|
+
<span class="ruby-identifier">polynomial_regression</span>.<span class="ruby-identifier">methods</span>(:<span class="ruby-identifier">get</span>).<span class="ruby-identifier">y</span> <span class="ruby-comment"># => [23, 62, ..., 23]</span>
|
446
|
+
<span class="ruby-identifier">polynomial_regression</span>.<span class="ruby-identifier">statuses</span>(<span class="ruby-value">200</span>).<span class="ruby-identifier">y</span> <span class="ruby-comment"># => [51, 22, ..., 15]</span>
|
447
|
+
<span class="ruby-identifier">polynomial_regression</span>.<span class="ruby-identifier">paths</span>(<span class="ruby-string">"/"</span>).<span class="ruby-identifier">y</span> <span class="ruby-comment"># => [78, 12, ..., 63]</span>
|
448
|
+
<span class="ruby-identifier">polynomial_regression</span>.<span class="ruby-identifier">benchmarks</span>(<span class="ruby-string">"index page"</span>).<span class="ruby-identifier">y</span> <span class="ruby-comment"># => [12, 45, ..., 23]</span>
|
449
|
+
<span class="ruby-identifier">polynomial_regression</span>.<span class="ruby-identifier">durations</span>.<span class="ruby-identifier">degree</span> <span class="ruby-comment"># => 1</span>
|
450
|
+
<span class="ruby-identifier">polynomial_regression</span>.<span class="ruby-identifier">durations</span>.<span class="ruby-identifier">formula</span> <span class="ruby-comment"># => "43.00886000234 + 0.0167548964060689x^1"</span>
|
451
|
+
|
452
|
+
<span class="ruby-comment"># 1. Derivation</span>
|
453
|
+
<span class="ruby-identifier">polynomial_regression</span>.<span class="ruby-identifier">durations</span>.<span class="ruby-identifier">derivation</span>(<span class="ruby-value">1</span>) <span class="ruby-comment"># => [0.01, 0.01, ..., 0.01]</span>
|
454
|
+
<span class="ruby-identifier">polynomial_regression</span>.<span class="ruby-identifier">requests</span>.<span class="ruby-identifier">derivation</span>(<span class="ruby-value">1</span>) <span class="ruby-comment"># => [405, 405, ..., 406]</span>
|
455
|
+
<span class="ruby-identifier">polynomial_regression</span>.<span class="ruby-identifier">methods</span>(:<span class="ruby-identifier">get</span>).<span class="ruby-identifier">derivation</span>(<span class="ruby-value">1</span>) <span class="ruby-comment"># => [23, 62, ..., 23]</span>
|
456
|
+
<span class="ruby-identifier">polynomial_regression</span>.<span class="ruby-identifier">statuses</span>(<span class="ruby-value">200</span>).<span class="ruby-identifier">derivation</span>(<span class="ruby-value">1</span>) <span class="ruby-comment"># => [51, 22, ..., 15]</span>
|
457
|
+
<span class="ruby-identifier">polynomial_regression</span>.<span class="ruby-identifier">paths</span>(<span class="ruby-string">"/"</span>).<span class="ruby-identifier">derivation</span>(<span class="ruby-value">1</span>) <span class="ruby-comment"># => [78, 12, ..., 63]</span>
|
458
|
+
<span class="ruby-identifier">polynomial_regression</span>.<span class="ruby-identifier">benchmarks</span>(<span class="ruby-string">"index page"</span>).<span class="ruby-identifier">derivation</span>(<span class="ruby-value">1</span>) <span class="ruby-comment"># => [12, 45, ..., 23]</span>
|
459
|
+
<span class="ruby-identifier">polynomial_regression</span>.<span class="ruby-identifier">durations</span>.<span class="ruby-identifier">formula</span>(<span class="ruby-value">1</span>) <span class="ruby-comment"># => "0.0167548964060689"</span>
|
460
|
+
|
461
|
+
<span class="ruby-comment"># Quadratic regression</span>
|
462
|
+
<span class="ruby-identifier">polynomial_regression</span>(:<span class="ruby-identifier">degree</span> =<span class="ruby-operator">></span> <span class="ruby-value">2</span>).<span class="ruby-identifier">requests</span>.<span class="ruby-identifier">x</span> <span class="ruby-comment"># => [1, 2, ..., 120]</span>
|
463
|
+
<span class="ruby-identifier">polynomial_regression</span>(:<span class="ruby-identifier">degree</span> =<span class="ruby-operator">></span> <span class="ruby-value">2</span>).<span class="ruby-identifier">durations</span>.<span class="ruby-identifier">y</span> <span class="ruby-comment"># => [43, 41, ..., 44]</span>
|
464
|
+
<span class="ruby-identifier">polynomial_regression</span>(:<span class="ruby-identifier">degree</span> =<span class="ruby-operator">></span> <span class="ruby-value">2</span>).<span class="ruby-identifier">requests</span>.<span class="ruby-identifier">y</span> <span class="ruby-comment"># => [43, 41, ..., 44]</span>
|
465
|
+
<span class="ruby-identifier">polynomial_regression</span>(:<span class="ruby-identifier">degree</span> =<span class="ruby-operator">></span> <span class="ruby-value">2</span>).<span class="ruby-identifier">methods</span>(:<span class="ruby-identifier">get</span>).<span class="ruby-identifier">y</span> <span class="ruby-comment"># => [23, 62, ..., 23]</span>
|
466
|
+
<span class="ruby-identifier">polynomial_regression</span>(:<span class="ruby-identifier">degree</span> =<span class="ruby-operator">></span> <span class="ruby-value">2</span>).<span class="ruby-identifier">statuses</span>(<span class="ruby-value">200</span>).<span class="ruby-identifier">y</span> <span class="ruby-comment"># => [51, 22, ..., 15]</span>
|
467
|
+
<span class="ruby-identifier">polynomial_regression</span>(:<span class="ruby-identifier">degree</span> =<span class="ruby-operator">></span> <span class="ruby-value">2</span>).<span class="ruby-identifier">paths</span>(<span class="ruby-string">"/"</span>).<span class="ruby-identifier">y</span> <span class="ruby-comment"># => [78, 12, ..., 63]</span>
|
468
|
+
<span class="ruby-identifier">polynomial_regression</span>(:<span class="ruby-identifier">degree</span> =<span class="ruby-operator">></span> <span class="ruby-value">2</span>).<span class="ruby-identifier">benchmarks</span>(<span class="ruby-string">"index page"</span>).<span class="ruby-identifier">y</span> <span class="ruby-comment"># => [12, 45, ..., 23]</span>
|
469
|
+
<span class="ruby-identifier">polynomial_regression</span>(:<span class="ruby-identifier">degree</span> =<span class="ruby-operator">></span> <span class="ruby-value">2</span>).<span class="ruby-identifier">requests</span>.<span class="ruby-identifier">formula</span> <span class="ruby-comment"># => "33.00886000234 + 0.0167548964060689x^1 + 0.0167548964060689x^2"</span>
|
470
|
+
|
471
|
+
<span class="ruby-comment"># Different timebase clustering</span>
|
472
|
+
<span class="ruby-identifier">polynomial_regression</span>(:<span class="ruby-identifier">degree</span> =<span class="ruby-operator">></span> <span class="ruby-value">2</span>, :<span class="ruby-identifier">timebase</span> =<span class="ruby-operator">></span> <span class="ruby-value">1</span>.<span class="ruby-identifier">minute</span>).<span class="ruby-identifier">requests</span>.<span class="ruby-identifier">x</span> <span class="ruby-comment"># => [0, 1]</span>
|
473
|
+
<span class="ruby-identifier">polynomial_regression</span>(:<span class="ruby-identifier">degree</span> =<span class="ruby-operator">></span> <span class="ruby-value">2</span>, :<span class="ruby-identifier">timebase</span> =<span class="ruby-operator">></span> <span class="ruby-value">1</span>.<span class="ruby-identifier">minute</span>).<span class="ruby-identifier">requests</span>.<span class="ruby-identifier">y</span> <span class="ruby-comment"># => [24032, 21893]</span>
|
474
|
+
<span class="ruby-identifier">polynomial_regression</span>(:<span class="ruby-identifier">degree</span> =<span class="ruby-operator">></span> <span class="ruby-value">2</span>, :<span class="ruby-identifier">timebase</span> =<span class="ruby-operator">></span> <span class="ruby-value">1</span>.<span class="ruby-identifier">minute</span>).<span class="ruby-identifier">durations</span>.<span class="ruby-identifier">y</span> <span class="ruby-comment"># => [43, 41]</span>
|
475
|
+
<span class="ruby-identifier">polynomial_regression</span>(:<span class="ruby-identifier">degree</span> =<span class="ruby-operator">></span> <span class="ruby-value">2</span>, :<span class="ruby-identifier">timebase</span> =<span class="ruby-operator">></span> <span class="ruby-value">1</span>.<span class="ruby-identifier">minute</span>).<span class="ruby-identifier">requests</span>.<span class="ruby-identifier">y</span> <span class="ruby-comment"># => [43, 41]</span>
|
476
|
+
<span class="ruby-identifier">polynomial_regression</span>(:<span class="ruby-identifier">degree</span> =<span class="ruby-operator">></span> <span class="ruby-value">2</span>, :<span class="ruby-identifier">timebase</span> =<span class="ruby-operator">></span> <span class="ruby-value">1</span>.<span class="ruby-identifier">minute</span>).<span class="ruby-identifier">methods</span>(:<span class="ruby-identifier">get</span>).<span class="ruby-identifier">y</span> <span class="ruby-comment"># => [23, 62]</span>
|
477
|
+
<span class="ruby-identifier">polynomial_regression</span>(:<span class="ruby-identifier">degree</span> =<span class="ruby-operator">></span> <span class="ruby-value">2</span>, :<span class="ruby-identifier">timebase</span> =<span class="ruby-operator">></span> <span class="ruby-value">1</span>.<span class="ruby-identifier">minute</span>).<span class="ruby-identifier">statuses</span>(<span class="ruby-value">200</span>).<span class="ruby-identifier">y</span> <span class="ruby-comment"># => [51, 22]</span>
|
478
|
+
<span class="ruby-identifier">polynomial_regression</span>(:<span class="ruby-identifier">degree</span> =<span class="ruby-operator">></span> <span class="ruby-value">2</span>, :<span class="ruby-identifier">timebase</span> =<span class="ruby-operator">></span> <span class="ruby-value">1</span>.<span class="ruby-identifier">minute</span>).<span class="ruby-identifier">paths</span>(<span class="ruby-string">"/"</span>).<span class="ruby-identifier">y</span> <span class="ruby-comment"># => [78, 12]</span>
|
479
|
+
<span class="ruby-identifier">polynomial_regression</span>(:<span class="ruby-identifier">degree</span> =<span class="ruby-operator">></span> <span class="ruby-value">2</span>, :<span class="ruby-identifier">timebase</span> =<span class="ruby-operator">></span> <span class="ruby-value">1</span>.<span class="ruby-identifier">minute</span>).<span class="ruby-identifier">benchmarks</span>(<span class="ruby-string">"index page"</span>).<span class="ruby-identifier">y</span> <span class="ruby-comment"># => [12, 45]</span>
|
480
|
+
</pre>
|
481
|
+
|
482
|
+
<h4 id="label-normal_distribution">normal_distribution</h4>
|
483
|
+
|
484
|
+
<p>The normal distribution method creates a Gaussian bell function that
|
485
|
+
visualizes the distribution of a special attribute. If you want to know if
|
486
|
+
all your requests take about the same time, or if they vary a lot this is
|
487
|
+
method to use. The x-values are automatically scaled to 4-times the
|
488
|
+
variance around the mean, so it should map the whole bell all the time.</p>
|
489
|
+
|
490
|
+
<pre class="ruby"><span class="ruby-comment"># Normal distribution without time clustering</span>
|
491
|
+
<span class="ruby-identifier">normal_distribution</span>.<span class="ruby-identifier">durations</span>.<span class="ruby-identifier">x</span> <span class="ruby-comment"># => [1, 2, ..., 120]</span>
|
492
|
+
<span class="ruby-identifier">normal_distribution</span>.<span class="ruby-identifier">durations</span>.<span class="ruby-identifier">y</span> <span class="ruby-comment"># => [45, 23, ..., 36]</span>
|
493
|
+
<span class="ruby-identifier">normal_distribution</span>.<span class="ruby-identifier">durations</span>.<span class="ruby-identifier">formula</span> <span class="ruby-comment"># => "(1 / (10.242257627240862 * sqrt(2*PI))) * exp(-1 * ((x - 2.04671984377919)^2) / (2*10.242257627240862))"</span>
|
494
|
+
|
495
|
+
<span class="ruby-comment"># Normal distribution with default time slicing of 1.second</span>
|
496
|
+
<span class="ruby-identifier">normal_distribution</span>.<span class="ruby-identifier">requests</span>.<span class="ruby-identifier">y</span> <span class="ruby-comment"># => [43, 45, ..., 62]</span>
|
497
|
+
<span class="ruby-identifier">normal_distribution</span>.<span class="ruby-identifier">methods</span>(:<span class="ruby-identifier">get</span>).<span class="ruby-identifier">y</span> <span class="ruby-comment"># => [23, 62, ..., 23]</span>
|
498
|
+
<span class="ruby-identifier">normal_distribution</span>.<span class="ruby-identifier">statuses</span>(<span class="ruby-value">200</span>).<span class="ruby-identifier">y</span> <span class="ruby-comment"># => [51, 22, ..., 15]</span>
|
499
|
+
<span class="ruby-identifier">normal_distribution</span>.<span class="ruby-identifier">paths</span>(<span class="ruby-string">"/"</span>).<span class="ruby-identifier">y</span> <span class="ruby-comment"># => [78, 12, ..., 63]</span>
|
500
|
+
<span class="ruby-identifier">normal_distribution</span>.<span class="ruby-identifier">benchmarks</span>(<span class="ruby-string">"index page"</span>).<span class="ruby-identifier">y</span> <span class="ruby-comment"># => [12, 45, ..., 23]</span>
|
501
|
+
|
502
|
+
<span class="ruby-comment"># Normal distribution with custom time slicing</span>
|
503
|
+
<span class="ruby-identifier">normal_distribution</span>(<span class="ruby-value">1</span>.<span class="ruby-identifier">minute</span>).<span class="ruby-identifier">requests</span>.<span class="ruby-identifier">y</span> <span class="ruby-comment"># => [43, 45, ..., 62]</span>
|
504
|
+
<span class="ruby-identifier">normal_distribution</span>(<span class="ruby-value">1</span>.<span class="ruby-identifier">minute</span>).<span class="ruby-identifier">methods</span>(:<span class="ruby-identifier">get</span>).<span class="ruby-identifier">y</span> <span class="ruby-comment"># => [23, 62, ..., 23]</span>
|
505
|
+
<span class="ruby-identifier">normal_distribution</span>(<span class="ruby-value">1</span>.<span class="ruby-identifier">minute</span>).<span class="ruby-identifier">statuses</span>(<span class="ruby-value">200</span>).<span class="ruby-identifier">y</span> <span class="ruby-comment"># => [51, 22, ..., 15]</span>
|
506
|
+
<span class="ruby-identifier">normal_distribution</span>(<span class="ruby-value">1</span>.<span class="ruby-identifier">minute</span>).<span class="ruby-identifier">paths</span>(<span class="ruby-string">"/"</span>).<span class="ruby-identifier">y</span> <span class="ruby-comment"># => [78, 12, ..., 63]</span>
|
507
|
+
<span class="ruby-identifier">normal_distribution</span>(<span class="ruby-value">1</span>.<span class="ruby-identifier">minute</span>).<span class="ruby-identifier">benchmarks</span>(<span class="ruby-string">"index page"</span>).<span class="ruby-identifier">y</span> <span class="ruby-comment"># => [12, 45, ..., 23]</span>
|
508
|
+
</pre>
|
509
|
+
|
510
|
+
<h4 id="label-scope_to_benchmark">scope_to_benchmark</h4>
|
511
|
+
|
512
|
+
<p>The scope_to_benchmark method lets you scope any result to a single
|
513
|
+
benchmark. The values computed in this block have entirely been created by
|
514
|
+
this benchmark.</p>
|
515
|
+
|
516
|
+
<pre class="ruby"><span class="ruby-comment"># Results for the index page benchmark</span>
|
517
|
+
<span class="ruby-identifier">scope_to_benchmark</span> <span class="ruby-string">"index page"</span> <span class="ruby-keyword">do</span>
|
518
|
+
<span class="ruby-identifier">cluster</span>.<span class="ruby-identifier">durations</span> <span class="ruby-comment"># => [43, 96, ..., 41]</span>
|
519
|
+
<span class="ruby-identifier">cluster</span>.<span class="ruby-identifier">requests</span> <span class="ruby-comment"># => [503, 541, ..., 511]</span>
|
520
|
+
<span class="ruby-identifier">cluster</span>.<span class="ruby-identifier">methods</span>(:<span class="ruby-identifier">get</span>) <span class="ruby-comment"># => [200, 204, ..., 209]</span>
|
521
|
+
<span class="ruby-identifier">cluster</span>.<span class="ruby-identifier">methods</span>(:<span class="ruby-identifier">post</span>) <span class="ruby-comment"># => [201, 102, ..., 401]</span>
|
522
|
+
<span class="ruby-identifier">polynomial_regression</span>.<span class="ruby-identifier">durations</span>.<span class="ruby-identifier">x</span> <span class="ruby-comment"># => [1, 2, ..., 120]</span>
|
523
|
+
<span class="ruby-identifier">polynomial_regression</span>.<span class="ruby-identifier">durations</span>.<span class="ruby-identifier">y</span> <span class="ruby-comment"># => [45, 23, ..., 36]</span>
|
524
|
+
<span class="ruby-identifier">normal_distribution</span>.<span class="ruby-identifier">requests</span>.<span class="ruby-identifier">y</span> <span class="ruby-comment"># => [43, 45, ..., 62]</span>
|
525
|
+
<span class="ruby-identifier">normal_distribution</span>.<span class="ruby-identifier">methods</span>(:<span class="ruby-identifier">get</span>).<span class="ruby-identifier">y</span> <span class="ruby-comment"># => [23, 62, ..., 23]</span>
|
526
|
+
<span class="ruby-identifier">normal_distribution</span>.<span class="ruby-identifier">statuses</span>(<span class="ruby-value">200</span>).<span class="ruby-identifier">y</span> <span class="ruby-comment"># => [51, 22, ..., 15]</span>
|
527
|
+
<span class="ruby-keyword">end</span>
|
528
|
+
|
529
|
+
<span class="ruby-comment"># Results for the login and logout benchmark</span>
|
530
|
+
<span class="ruby-identifier">scope_to_benchmark</span> <span class="ruby-string">"login and logout"</span> <span class="ruby-keyword">do</span>
|
531
|
+
<span class="ruby-identifier">cluster</span>.<span class="ruby-identifier">durations</span> <span class="ruby-comment"># => [43, 96, ..., 41]</span>
|
532
|
+
<span class="ruby-identifier">cluster</span>.<span class="ruby-identifier">requests</span> <span class="ruby-comment"># => [300, 141, ..., 511]</span>
|
533
|
+
<span class="ruby-identifier">cluster</span>.<span class="ruby-identifier">methods</span>(:<span class="ruby-identifier">get</span>) <span class="ruby-comment"># => [100, 204, ..., 209]</span>
|
534
|
+
<span class="ruby-identifier">cluster</span>.<span class="ruby-identifier">methods</span>(:<span class="ruby-identifier">post</span>) <span class="ruby-comment"># => [101, 102, ..., 401]</span>
|
535
|
+
<span class="ruby-identifier">polynomial_regression</span>.<span class="ruby-identifier">durations</span>.<span class="ruby-identifier">x</span> <span class="ruby-comment"># => [1, 2, ..., 120]</span>
|
536
|
+
<span class="ruby-identifier">polynomial_regression</span>.<span class="ruby-identifier">durations</span>.<span class="ruby-identifier">y</span> <span class="ruby-comment"># => [45, 23, ..., 36]</span>
|
537
|
+
<span class="ruby-identifier">normal_distribution</span>.<span class="ruby-identifier">requests</span>.<span class="ruby-identifier">y</span> <span class="ruby-comment"># => [43, 45, ..., 62]</span>
|
538
|
+
<span class="ruby-identifier">normal_distribution</span>.<span class="ruby-identifier">methods</span>(:<span class="ruby-identifier">get</span>).<span class="ruby-identifier">y</span> <span class="ruby-comment"># => [23, 62, ..., 23]</span>
|
539
|
+
<span class="ruby-identifier">normal_distribution</span>.<span class="ruby-identifier">statuses</span>(<span class="ruby-value">200</span>).<span class="ruby-identifier">y</span> <span class="ruby-comment"># => [51, 22, ..., 15]</span>
|
540
|
+
<span class="ruby-keyword">end</span>
|
541
|
+
</pre>
|
542
|
+
|
543
|
+
<h4 id="label-each_benchmark">each_benchmark</h4>
|
544
|
+
|
545
|
+
<p>Iterates over all benchmarks and automatically scopes the results at each
|
546
|
+
iteration to the current benchmark. This is useful if you want to access
|
547
|
+
the detailed differences of each benchmark.</p>
|
548
|
+
|
549
|
+
<pre class="ruby"><span class="ruby-comment"># Iterate over all benchmarks and calculate the results</span>
|
550
|
+
<span class="ruby-identifier">each_benchmark</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">benchmark</span><span class="ruby-operator">|</span>
|
551
|
+
<span class="ruby-identifier">benchmark</span>.<span class="ruby-identifier">name</span> <span class="ruby-comment"># => "index page" then "login and logout"</span>
|
552
|
+
|
553
|
+
<span class="ruby-identifier">cluster</span>.<span class="ruby-identifier">durations</span> <span class="ruby-comment"># => [43, 96, ..., 41]</span>
|
554
|
+
<span class="ruby-identifier">cluster</span>.<span class="ruby-identifier">requests</span> <span class="ruby-comment"># => [300, 141, ..., 511]</span>
|
555
|
+
<span class="ruby-identifier">cluster</span>.<span class="ruby-identifier">methods</span>(:<span class="ruby-identifier">get</span>) <span class="ruby-comment"># => [100, 204, ..., 209]</span>
|
556
|
+
<span class="ruby-identifier">cluster</span>.<span class="ruby-identifier">methods</span>(:<span class="ruby-identifier">post</span>) <span class="ruby-comment"># => [101, 102, ..., 401]</span>
|
557
|
+
<span class="ruby-identifier">polynomial_regression</span>.<span class="ruby-identifier">durations</span>.<span class="ruby-identifier">x</span> <span class="ruby-comment"># => [1, 2, ..., 120]</span>
|
558
|
+
<span class="ruby-identifier">polynomial_regression</span>.<span class="ruby-identifier">durations</span>.<span class="ruby-identifier">y</span> <span class="ruby-comment"># => [45, 23, ..., 36]</span>
|
559
|
+
<span class="ruby-identifier">normal_distribution</span>.<span class="ruby-identifier">requests</span>.<span class="ruby-identifier">y</span> <span class="ruby-comment"># => [43, 45, ..., 62]</span>
|
560
|
+
<span class="ruby-identifier">normal_distribution</span>.<span class="ruby-identifier">methods</span>(:<span class="ruby-identifier">get</span>).<span class="ruby-identifier">y</span> <span class="ruby-comment"># => [23, 62, ..., 23]</span>
|
561
|
+
<span class="ruby-identifier">normal_distribution</span>.<span class="ruby-identifier">statuses</span>(<span class="ruby-value">200</span>).<span class="ruby-identifier">y</span> <span class="ruby-comment"># => [51, 22, ..., 15]</span>
|
562
|
+
<span class="ruby-keyword">end</span>
|
563
|
+
</pre>
|
564
|
+
|
565
|
+
<h3 id="label-Running+Post+Processors+separately">Running Post Processors separately</h3>
|
566
|
+
|
567
|
+
<p>You can also re-run the currently defined post processors or run a separate
|
568
|
+
post processor you never even defined in the first place without collecting
|
569
|
+
the test data again like this:</p>
|
570
|
+
|
571
|
+
<pre># Re-run the postprocessors defined in example.rb
|
572
|
+
bigbench run postprocessors example.rb
|
573
|
+
|
574
|
+
# Run a separate post processor independently - the already defined post processors are ignored
|
575
|
+
bigbench run postprocessor example.rb statistics</pre>
|
576
|
+
|
577
|
+
<p>Contribute, create great post processors and send me a pull request!</p>
|
578
|
+
|
579
|
+
<h3 id="label-Statistics">Statistics</h3>
|
580
|
+
|
581
|
+
<p>The statistics post processor computes a simple overview of the benchmark
|
582
|
+
and prints it to the terminal like this:</p>
|
583
|
+
|
584
|
+
<pre>BigBench Statistics
|
585
|
+
+---------------------------+------------------+---------+
|
586
|
+
| Name | Value | Percent |
|
587
|
+
+---------------------------+------------------+---------+
|
588
|
+
| Total Requests: | 52,469 | 100% |
|
589
|
+
| Total Errors: | 0 | 0.0% |
|
590
|
+
| | | |
|
591
|
+
| Average Requests/Second: | 437 Requests/sec | |
|
592
|
+
| Average Request Duration: | 1 ms | |
|
593
|
+
| | | |
|
594
|
+
| Max Request Duration: | 181 ms | |
|
595
|
+
| Min Request Duration: | 1 ms | |
|
596
|
+
| | | |
|
597
|
+
| Status Codes: | | |
|
598
|
+
| 200 | 52469 | 100.0% |
|
599
|
+
| | | |
|
600
|
+
| HTTP Methods | | |
|
601
|
+
| get | 34980 | 66.7% |
|
602
|
+
| post | 17489 | 33.3% |
|
603
|
+
| | | |
|
604
|
+
| URL Paths: | | |
|
605
|
+
| / | 34979 | 66.7% |
|
606
|
+
| /basic/auth | 17490 | 33.3% |
|
607
|
+
+---------------------------+------------------+---------+
|
608
|
+
19 rows in set</pre>
|
609
|
+
|
610
|
+
<h2 id="label-Load+Comparison">Load Comparison</h2>
|
611
|
+
|
612
|
+
<p><a href="BigBench.html">BigBench</a> is awfully good at creating high loads
|
613
|
+
on web servers. A quick benchmark comparison to <a
|
614
|
+
href="http://jmeter.apache.org/">Apache's JMeter</a> shows that <a
|
615
|
+
href="BigBench.html">BigBench</a> is able to create 16% more load than
|
616
|
+
JMeter.</p>
|
617
|
+
|
618
|
+
<h3 id="label-Test+Configuration%3A+Apache%27s+JMeter+vs.+BigBench">Test Configuration: Apache’s JMeter vs. <a href="BigBench.html">BigBench</a></h3>
|
619
|
+
|
620
|
+
<table>
|
621
|
+
|
622
|
+
<tr>
|
623
|
+
<th>Parameter </th>
|
624
|
+
<th>Value </th>
|
625
|
+
</tr>
|
626
|
+
<tr>
|
627
|
+
<td> Test Duration </td>
|
628
|
+
<td> 2 Minutes </td>
|
629
|
+
</tr>
|
630
|
+
<tr>
|
631
|
+
<td> Concurrency(Threads) </td>
|
632
|
+
<td> 20 </td>
|
633
|
+
</tr>
|
634
|
+
<tr>
|
635
|
+
<td> Rack Server </td>
|
636
|
+
<td> Thin </td>
|
637
|
+
</tr>
|
638
|
+
<tr>
|
639
|
+
<td> Rack Host </td>
|
640
|
+
<td> localhost </td>
|
641
|
+
</tr>
|
642
|
+
<tr>
|
643
|
+
<td> Rack Request </td>
|
644
|
+
<td> GET: 200, Body: Test </td>
|
645
|
+
</tr>
|
646
|
+
<tr>
|
647
|
+
<td> Ruby Version </td>
|
648
|
+
<td> ruby 1.9.3p125 [x86_64-darwin11.3.0] </td>
|
649
|
+
</tr>
|
650
|
+
<tr>
|
651
|
+
<td> JMeter Version </td>
|
652
|
+
<td> 2.6 r1237317 </td>
|
653
|
+
</tr>
|
654
|
+
<tr>
|
655
|
+
<td> BigBench Version </td>
|
656
|
+
<td> 0.2 </td>
|
657
|
+
</tr>
|
658
|
+
|
659
|
+
</table>
|
660
|
+
|
661
|
+
<h3 id="label-Test+Results">Test Results</h3>
|
662
|
+
|
663
|
+
<table>
|
664
|
+
|
665
|
+
<tr>
|
666
|
+
<th>Value </th>
|
667
|
+
<th>JMeter </th>
|
668
|
+
<th>BigBench </th>
|
669
|
+
</tr>
|
670
|
+
<tr>
|
671
|
+
<td> Total Requests </td>
|
672
|
+
<td> 48.014 </td>
|
673
|
+
<td> 55.484 </td>
|
674
|
+
</tr>
|
675
|
+
<tr>
|
676
|
+
<td> Requests/sec </td>
|
677
|
+
<td> 377 </td>
|
678
|
+
<td> 462 </td>
|
679
|
+
</tr>
|
680
|
+
<tr>
|
681
|
+
<td> Percentages </td>
|
682
|
+
<td> 100%% </td>
|
683
|
+
<td> 116% </td>
|
684
|
+
</tr>
|
685
|
+
|
686
|
+
</table>
|
687
|
+
|
688
|
+
<h2 id="label-Version+History">Version History</h2>
|
689
|
+
|
690
|
+
<h3 id="label-0.4">0.4</h3>
|
691
|
+
<ul><li>
|
692
|
+
<p>Added command line tool to run the post processors again</p>
|
693
|
+
</li><li>
|
694
|
+
<p>Added command line tool to run any post processor on already collected data</p>
|
695
|
+
</li><li>
|
696
|
+
<p>Pimped the post processor environment. Available functions now include:</p>
|
697
|
+
</li><li>
|
698
|
+
<p>trackings array is now available with all hashes of the trackings at once</p>
|
699
|
+
</li><li>
|
700
|
+
<p><strong>Clustering by any timebase</strong>, e.g. <code>1.second</code>,
|
701
|
+
<code>20.seconds</code>, or <code>2.minutes</code> which automatically
|
702
|
+
calculates these values per time slice:</p>
|
703
|
+
</li><li><ul><li>
|
704
|
+
<p><code>average duration</code></p>
|
705
|
+
</li></ul>
|
706
|
+
</li><li><ul><li>
|
707
|
+
<p><code>requests</code></p>
|
708
|
+
</li></ul>
|
709
|
+
</li><li><ul><li>
|
710
|
+
<p><code>methods(:get, :post, :put, ...)</code></p>
|
711
|
+
</li></ul>
|
712
|
+
</li><li><ul><li>
|
713
|
+
<p><code>statuses(200, 404, 403, ...)</code></p>
|
714
|
+
</li></ul>
|
715
|
+
</li><li><ul><li>
|
716
|
+
<p><code>paths("/", "/logout", "/login",
|
717
|
+
...)</code></p>
|
718
|
+
</li></ul>
|
719
|
+
</li><li><ul><li>
|
720
|
+
<p><code>benchmarks("index page", "user behavior",
|
721
|
+
"bot crawling", ...)</code></p>
|
722
|
+
</li></ul>
|
723
|
+
</li><li>
|
724
|
+
<p><strong>Polynomial Regression of any Degree</strong> for all attributes
|
725
|
+
including the derivatives and a formula printer</p>
|
726
|
+
</li><li>
|
727
|
+
<p><strong>Statistics</strong> with the following values for all attributes:</p>
|
728
|
+
</li><li><ul><li>
|
729
|
+
<p><code>max</code></p>
|
730
|
+
</li></ul>
|
731
|
+
</li><li><ul><li>
|
732
|
+
<p><code>min</code></p>
|
733
|
+
</li></ul>
|
734
|
+
</li><li><ul><li>
|
735
|
+
<p><code>mean</code></p>
|
736
|
+
</li></ul>
|
737
|
+
</li><li><ul><li>
|
738
|
+
<p><code>standard_deviation</code></p>
|
739
|
+
</li></ul>
|
740
|
+
</li><li><ul><li>
|
741
|
+
<p><code>squared_deviation</code> or <code>variance</code></p>
|
742
|
+
</li></ul>
|
743
|
+
</li><li>
|
744
|
+
<p><strong>Gaussian Normal Distribution</strong> for all attributes including
|
745
|
+
a <strong>formula printer</strong></p>
|
746
|
+
</li><li>
|
747
|
+
<p><strong>Appearing</strong> method to quickly list all appearing
|
748
|
+
<code>statuses</code>, <code>methods</code>, <code>paths</code> in the test
|
749
|
+
results</p>
|
750
|
+
</li></ul>
|
751
|
+
|
752
|
+
<h3 id="label-0.3">0.3</h3>
|
753
|
+
<ul><li>
|
754
|
+
<p>Added post processors hook that run after the benchmark with a simple
|
755
|
+
plugin structure</p>
|
756
|
+
</li><li>
|
757
|
+
<p>Added a first basic post processor that computes the benchmark statistics
|
758
|
+
and prints them in the terminal</p>
|
759
|
+
</li><li>
|
760
|
+
<p>Added ability to execute a block of code after running the benchmark. The
|
761
|
+
code can do anything usefully like send emails, post twitter notifications
|
762
|
+
or startup new servers</p>
|
763
|
+
</li></ul>
|
764
|
+
|
765
|
+
<h3 id="label-0.2">0.2</h3>
|
766
|
+
<ul><li>
|
767
|
+
<p><code>Net::HTTP</code> was too slow. Only reached 35% of Apache's JMeter
|
768
|
+
load. Changed requesting structure to <a
|
769
|
+
href="https://github.com/eventmachine/eventmachine">eventmachine</a> using
|
770
|
+
<a href="https://github.com/igrigorik/em-http-request">em-http-request</a></p>
|
771
|
+
</li><li>
|
772
|
+
<p>Compared to JMeter it can create 16% <strong>more</strong> load than JMeter
|
773
|
+
now</p>
|
774
|
+
</li><li>
|
775
|
+
<p>Changed config option from <code>threads</code> to <code>users</code> due
|
776
|
+
to a better understanding</p>
|
777
|
+
</li><li>
|
778
|
+
<p>Added basic auth support</p>
|
779
|
+
</li><li>
|
780
|
+
<p>Added params hashes for request content</p>
|
781
|
+
</li></ul>
|
782
|
+
|
783
|
+
<h3 id="label-0.1">0.1</h3>
|
784
|
+
<ul><li>
|
785
|
+
<p>Initial Version using <code>Net::HTTP</code></p>
|
786
|
+
</li><li>
|
787
|
+
<p>Local and bot testing</p>
|
788
|
+
</li><li>
|
789
|
+
<p>LJSON output</p>
|
790
|
+
</li><li>
|
791
|
+
<p>Global configuration</p>
|
792
|
+
</li></ul>
|
793
|
+
|
794
|
+
</div>
|
129
795
|
|
130
796
|
|
131
797
|
<footer id="validator-badges">
|