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/Helpers.html
CHANGED
@@ -58,7 +58,17 @@
|
|
58
58
|
|
59
59
|
|
60
60
|
|
61
|
+
<!-- Method Quickref -->
|
62
|
+
<nav id="method-list-section" class="section">
|
63
|
+
<h3 class="section-header">Methods</h3>
|
64
|
+
|
65
|
+
<ul class="link-list">
|
66
|
+
|
67
|
+
<li><a href="#method-i-validate_normal_distribution">#validate_normal_distribution</a>
|
61
68
|
|
69
|
+
</ul>
|
70
|
+
</nav>
|
71
|
+
|
62
72
|
</div>
|
63
73
|
|
64
74
|
<div id="project-metadata">
|
@@ -69,6 +79,8 @@
|
|
69
79
|
|
70
80
|
<li class="file"><a href="./Gemfile.html">Gemfile</a>
|
71
81
|
|
82
|
+
<li class="file"><a href="./README_rdoc.html">README</a>
|
83
|
+
|
72
84
|
<li class="file"><a href="./Rakefile.html">Rakefile</a>
|
73
85
|
|
74
86
|
<li class="file"><a href="./lib/bigbench/help/executor_txt.html">executor</a>
|
@@ -111,6 +123,26 @@
|
|
111
123
|
|
112
124
|
<li><a href="./BigBench/PostProcessor/Environment.html">BigBench::PostProcessor::Environment</a>
|
113
125
|
|
126
|
+
<li><a href="./BigBench/PostProcessor/Environment/Appearings.html">BigBench::PostProcessor::Environment::Appearings</a>
|
127
|
+
|
128
|
+
<li><a href="./BigBench/PostProcessor/Environment/AttributeCluster.html">BigBench::PostProcessor::Environment::AttributeCluster</a>
|
129
|
+
|
130
|
+
<li><a href="./BigBench/PostProcessor/Environment/BenchmarkNotFound.html">BigBench::PostProcessor::Environment::BenchmarkNotFound</a>
|
131
|
+
|
132
|
+
<li><a href="./BigBench/PostProcessor/Environment/Cluster.html">BigBench::PostProcessor::Environment::Cluster</a>
|
133
|
+
|
134
|
+
<li><a href="./BigBench/PostProcessor/Environment/NormalDistribution.html">BigBench::PostProcessor::Environment::NormalDistribution</a>
|
135
|
+
|
136
|
+
<li><a href="./BigBench/PostProcessor/Environment/PolynomialRegression.html">BigBench::PostProcessor::Environment::PolynomialRegression</a>
|
137
|
+
|
138
|
+
<li><a href="./BigBench/PostProcessor/Environment/Statistics.html">BigBench::PostProcessor::Environment::Statistics</a>
|
139
|
+
|
140
|
+
<li><a href="./BigBench/PostProcessor/Graphs.html">BigBench::PostProcessor::Graphs</a>
|
141
|
+
|
142
|
+
<li><a href="./BigBench/PostProcessor/Graphs/LineGraph.html">BigBench::PostProcessor::Graphs::LineGraph</a>
|
143
|
+
|
144
|
+
<li><a href="./BigBench/PostProcessor/Graphs/PieGraph.html">BigBench::PostProcessor::Graphs::PieGraph</a>
|
145
|
+
|
114
146
|
<li><a href="./BigBench/PostProcessor/InvalidProcessor.html">BigBench::PostProcessor::InvalidProcessor</a>
|
115
147
|
|
116
148
|
<li><a href="./BigBench/PostProcessor/Processor.html">BigBench::PostProcessor::Processor</a>
|
@@ -129,6 +161,8 @@
|
|
129
161
|
|
130
162
|
<li><a href="./BigBench/Tracker/Tracker.html">BigBench::Tracker::Tracker</a>
|
131
163
|
|
164
|
+
<li><a href="./Array.html">Array</a>
|
165
|
+
|
132
166
|
<li><a href="./EventMachineLoop.html">EventMachineLoop</a>
|
133
167
|
|
134
168
|
<li><a href="./Float.html">Float</a>
|
@@ -164,6 +198,50 @@
|
|
164
198
|
|
165
199
|
<!-- Methods -->
|
166
200
|
|
201
|
+
<section id="public-instance-5Buntitled-5D-method-details" class="method-section section">
|
202
|
+
<h3 class="section-header">Public Instance Methods</h3>
|
203
|
+
|
204
|
+
|
205
|
+
<div id="method-i-validate_normal_distribution" class="method-detail ">
|
206
|
+
|
207
|
+
<div class="method-heading">
|
208
|
+
<span class="method-name">validate_normal_distribution</span><span
|
209
|
+
class="method-args">(distribution)</span>
|
210
|
+
<span class="method-click-advice">click to toggle source</span>
|
211
|
+
</div>
|
212
|
+
|
213
|
+
|
214
|
+
<div class="method-description">
|
215
|
+
|
216
|
+
|
217
|
+
|
218
|
+
|
219
|
+
|
220
|
+
<div class="method-source-code" id="validate_normal_distribution-source">
|
221
|
+
<pre><span class="ruby-comment"># File spec/helpers.rb, line 10</span>
|
222
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">validate_normal_distribution</span> <span class="ruby-identifier">distribution</span>
|
223
|
+
<span class="ruby-identifier">center_index</span>, <span class="ruby-identifier">y</span> = (<span class="ruby-identifier">distribution</span>.<span class="ruby-identifier">x</span>.<span class="ruby-identifier">size</span> <span class="ruby-operator">/</span> <span class="ruby-value">2</span>), <span class="ruby-identifier">distribution</span>.<span class="ruby-identifier">y</span>
|
224
|
+
<span class="ruby-identifier">highest_value</span> = <span class="ruby-identifier">y</span>[<span class="ruby-identifier">center_index</span>] <span class="ruby-operator">+</span> <span class="ruby-value">1</span>
|
225
|
+
|
226
|
+
<span class="ruby-identifier">current_value</span> = <span class="ruby-value">0.0</span>
|
227
|
+
<span class="ruby-identifier">y</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">value</span><span class="ruby-operator">|</span>
|
228
|
+
<span class="ruby-identifier">value</span>.<span class="ruby-identifier">should</span> <span class="ruby-operator"><=</span> <span class="ruby-identifier">highest_value</span>
|
229
|
+
<span class="ruby-keyword">end</span>
|
230
|
+
|
231
|
+
<span class="ruby-keyword">true</span>
|
232
|
+
<span class="ruby-keyword">end</span></pre>
|
233
|
+
</div><!-- validate_normal_distribution-source -->
|
234
|
+
|
235
|
+
</div>
|
236
|
+
|
237
|
+
|
238
|
+
|
239
|
+
|
240
|
+
</div><!-- validate_normal_distribution-method -->
|
241
|
+
|
242
|
+
|
243
|
+
</section><!-- public-instance-method-details -->
|
244
|
+
|
167
245
|
</section><!-- 5Buntitled-5D -->
|
168
246
|
|
169
247
|
</div><!-- documentation -->
|
data/doc/Object.html
CHANGED
@@ -49,6 +49,7 @@
|
|
49
49
|
<ul>
|
50
50
|
<li>spec/helpers.rb
|
51
51
|
<li>spec/lib/test_web_server.rb
|
52
|
+
<li>spec/post_processors/environment_spec.rb
|
52
53
|
</ul>
|
53
54
|
</nav>
|
54
55
|
|
@@ -74,6 +75,10 @@
|
|
74
75
|
<li><a class="include" href="Helpers.html">Helpers</a>
|
75
76
|
|
76
77
|
|
78
|
+
|
79
|
+
<li><a class="include" href="BigBench/PostProcessor/Environment.html">BigBench::PostProcessor::Environment</a>
|
80
|
+
|
81
|
+
|
77
82
|
</ul>
|
78
83
|
</nav>
|
79
84
|
|
@@ -100,6 +105,8 @@
|
|
100
105
|
|
101
106
|
<li class="file"><a href="./Gemfile.html">Gemfile</a>
|
102
107
|
|
108
|
+
<li class="file"><a href="./README_rdoc.html">README</a>
|
109
|
+
|
103
110
|
<li class="file"><a href="./Rakefile.html">Rakefile</a>
|
104
111
|
|
105
112
|
<li class="file"><a href="./lib/bigbench/help/executor_txt.html">executor</a>
|
@@ -142,6 +149,26 @@
|
|
142
149
|
|
143
150
|
<li><a href="./BigBench/PostProcessor/Environment.html">BigBench::PostProcessor::Environment</a>
|
144
151
|
|
152
|
+
<li><a href="./BigBench/PostProcessor/Environment/Appearings.html">BigBench::PostProcessor::Environment::Appearings</a>
|
153
|
+
|
154
|
+
<li><a href="./BigBench/PostProcessor/Environment/AttributeCluster.html">BigBench::PostProcessor::Environment::AttributeCluster</a>
|
155
|
+
|
156
|
+
<li><a href="./BigBench/PostProcessor/Environment/BenchmarkNotFound.html">BigBench::PostProcessor::Environment::BenchmarkNotFound</a>
|
157
|
+
|
158
|
+
<li><a href="./BigBench/PostProcessor/Environment/Cluster.html">BigBench::PostProcessor::Environment::Cluster</a>
|
159
|
+
|
160
|
+
<li><a href="./BigBench/PostProcessor/Environment/NormalDistribution.html">BigBench::PostProcessor::Environment::NormalDistribution</a>
|
161
|
+
|
162
|
+
<li><a href="./BigBench/PostProcessor/Environment/PolynomialRegression.html">BigBench::PostProcessor::Environment::PolynomialRegression</a>
|
163
|
+
|
164
|
+
<li><a href="./BigBench/PostProcessor/Environment/Statistics.html">BigBench::PostProcessor::Environment::Statistics</a>
|
165
|
+
|
166
|
+
<li><a href="./BigBench/PostProcessor/Graphs.html">BigBench::PostProcessor::Graphs</a>
|
167
|
+
|
168
|
+
<li><a href="./BigBench/PostProcessor/Graphs/LineGraph.html">BigBench::PostProcessor::Graphs::LineGraph</a>
|
169
|
+
|
170
|
+
<li><a href="./BigBench/PostProcessor/Graphs/PieGraph.html">BigBench::PostProcessor::Graphs::PieGraph</a>
|
171
|
+
|
145
172
|
<li><a href="./BigBench/PostProcessor/InvalidProcessor.html">BigBench::PostProcessor::InvalidProcessor</a>
|
146
173
|
|
147
174
|
<li><a href="./BigBench/PostProcessor/Processor.html">BigBench::PostProcessor::Processor</a>
|
@@ -160,6 +187,8 @@
|
|
160
187
|
|
161
188
|
<li><a href="./BigBench/Tracker/Tracker.html">BigBench::Tracker::Tracker</a>
|
162
189
|
|
190
|
+
<li><a href="./Array.html">Array</a>
|
191
|
+
|
163
192
|
<li><a href="./EventMachineLoop.html">EventMachineLoop</a>
|
164
193
|
|
165
194
|
<li><a href="./Float.html">Float</a>
|
@@ -0,0 +1,803 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
|
3
|
+
<html>
|
4
|
+
<head>
|
5
|
+
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
|
6
|
+
|
7
|
+
<title>README - 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 class="file">
|
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="project-metadata">
|
47
|
+
<nav id="fileindex-section" class="section project-section">
|
48
|
+
<h3 class="section-header">Pages</h3>
|
49
|
+
|
50
|
+
<ul>
|
51
|
+
|
52
|
+
<li class="file"><a href="./Gemfile.html">Gemfile</a>
|
53
|
+
|
54
|
+
<li class="file"><a href="./README_rdoc.html">README</a>
|
55
|
+
|
56
|
+
<li class="file"><a href="./Rakefile.html">Rakefile</a>
|
57
|
+
|
58
|
+
<li class="file"><a href="./lib/bigbench/help/executor_txt.html">executor</a>
|
59
|
+
|
60
|
+
</ul>
|
61
|
+
</nav>
|
62
|
+
|
63
|
+
<nav id="classindex-section" class="section project-section">
|
64
|
+
<h3 class="section-header">Class and Module Index</h3>
|
65
|
+
|
66
|
+
<ul class="link-list">
|
67
|
+
|
68
|
+
<li><a href="./BigBench.html">BigBench</a>
|
69
|
+
|
70
|
+
<li><a href="./BigBench/Benchmark.html">BigBench::Benchmark</a>
|
71
|
+
|
72
|
+
<li><a href="./BigBench/Benchmark/Benchmark.html">BigBench::Benchmark::Benchmark</a>
|
73
|
+
|
74
|
+
<li><a href="./BigBench/Benchmark/Looper.html">BigBench::Benchmark::Looper</a>
|
75
|
+
|
76
|
+
<li><a href="./BigBench/Bot.html">BigBench::Bot</a>
|
77
|
+
|
78
|
+
<li><a href="./BigBench/Configuration.html">BigBench::Configuration</a>
|
79
|
+
|
80
|
+
<li><a href="./BigBench/Configuration/Config.html">BigBench::Configuration::Config</a>
|
81
|
+
|
82
|
+
<li><a href="./BigBench/Configuration/InvalidOptions.html">BigBench::Configuration::InvalidOptions</a>
|
83
|
+
|
84
|
+
<li><a href="./BigBench/Executor.html">BigBench::Executor</a>
|
85
|
+
|
86
|
+
<li><a href="./BigBench/Executor/InvalidCommand.html">BigBench::Executor::InvalidCommand</a>
|
87
|
+
|
88
|
+
<li><a href="./BigBench/Fragment.html">BigBench::Fragment</a>
|
89
|
+
|
90
|
+
<li><a href="./BigBench/Fragment/Fragment.html">BigBench::Fragment::Fragment</a>
|
91
|
+
|
92
|
+
<li><a href="./BigBench/Output.html">BigBench::Output</a>
|
93
|
+
|
94
|
+
<li><a href="./BigBench/PostProcessor.html">BigBench::PostProcessor</a>
|
95
|
+
|
96
|
+
<li><a href="./BigBench/PostProcessor/Environment.html">BigBench::PostProcessor::Environment</a>
|
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
|
+
|
118
|
+
<li><a href="./BigBench/PostProcessor/InvalidProcessor.html">BigBench::PostProcessor::InvalidProcessor</a>
|
119
|
+
|
120
|
+
<li><a href="./BigBench/PostProcessor/Processor.html">BigBench::PostProcessor::Processor</a>
|
121
|
+
|
122
|
+
<li><a href="./BigBench/PostProcessor/Statistics.html">BigBench::PostProcessor::Statistics</a>
|
123
|
+
|
124
|
+
<li><a href="./BigBench/PostProcessor/Test.html">BigBench::PostProcessor::Test</a>
|
125
|
+
|
126
|
+
<li><a href="./BigBench/Runner.html">BigBench::Runner</a>
|
127
|
+
|
128
|
+
<li><a href="./BigBench/Runner/NoBenchmarksDefined.html">BigBench::Runner::NoBenchmarksDefined</a>
|
129
|
+
|
130
|
+
<li><a href="./BigBench/Store.html">BigBench::Store</a>
|
131
|
+
|
132
|
+
<li><a href="./BigBench/Tracker.html">BigBench::Tracker</a>
|
133
|
+
|
134
|
+
<li><a href="./BigBench/Tracker/Tracker.html">BigBench::Tracker::Tracker</a>
|
135
|
+
|
136
|
+
<li><a href="./Array.html">Array</a>
|
137
|
+
|
138
|
+
<li><a href="./EventMachineLoop.html">EventMachineLoop</a>
|
139
|
+
|
140
|
+
<li><a href="./Float.html">Float</a>
|
141
|
+
|
142
|
+
<li><a href="./Helpers.html">Helpers</a>
|
143
|
+
|
144
|
+
<li><a href="./Object.html">Object</a>
|
145
|
+
|
146
|
+
</ul>
|
147
|
+
</nav>
|
148
|
+
|
149
|
+
</div>
|
150
|
+
</nav>
|
151
|
+
|
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
|
+
<p><table></p>
|
621
|
+
|
622
|
+
<pre><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></pre>
|
658
|
+
|
659
|
+
<p></table></p>
|
660
|
+
|
661
|
+
<h3 id="label-Test+Results">Test Results</h3>
|
662
|
+
|
663
|
+
<p><table></p>
|
664
|
+
|
665
|
+
<pre><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></pre>
|
685
|
+
|
686
|
+
<p></table></p>
|
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>
|
795
|
+
|
796
|
+
|
797
|
+
|
798
|
+
<footer id="validator-badges">
|
799
|
+
<p><a href="http://validator.w3.org/check/referer">[Validate]</a>
|
800
|
+
<p>Generated by <a href="https://github.com/rdoc/rdoc">RDoc</a> 3.12.
|
801
|
+
<p>Generated with the <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish Rdoc Generator</a> 3.
|
802
|
+
</footer>
|
803
|
+
|