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.
Files changed (74) hide show
  1. data/.DS_Store +0 -0
  2. data/README.textile +254 -4
  3. data/Rakefile +43 -9
  4. data/doc/Array.html +288 -0
  5. data/doc/BigBench.html +32 -6
  6. data/doc/BigBench/Benchmark.html +24 -0
  7. data/doc/BigBench/Benchmark/Benchmark.html +24 -0
  8. data/doc/BigBench/Benchmark/Looper.html +24 -0
  9. data/doc/BigBench/Bot.html +24 -0
  10. data/doc/BigBench/Configuration.html +24 -0
  11. data/doc/BigBench/Configuration/Config.html +24 -0
  12. data/doc/BigBench/Configuration/InvalidOptions.html +24 -0
  13. data/doc/BigBench/Executor.html +33 -3
  14. data/doc/BigBench/Executor/InvalidCommand.html +25 -1
  15. data/doc/BigBench/Fragment.html +24 -0
  16. data/doc/BigBench/Fragment/Fragment.html +24 -0
  17. data/doc/BigBench/Output.html +24 -0
  18. data/doc/BigBench/PostProcessor.html +33 -6
  19. data/doc/BigBench/PostProcessor/Environment.html +489 -2
  20. data/doc/BigBench/PostProcessor/Environment/Appearings.html +327 -0
  21. data/doc/BigBench/PostProcessor/Environment/AttributeCluster.html +275 -0
  22. data/doc/BigBench/PostProcessor/Environment/BenchmarkNotFound.html +293 -0
  23. data/doc/BigBench/PostProcessor/Environment/Cluster.html +387 -0
  24. data/doc/BigBench/PostProcessor/Environment/NormalDistribution.html +383 -0
  25. data/doc/BigBench/PostProcessor/Environment/PolynomialRegression.html +438 -0
  26. data/doc/BigBench/PostProcessor/Environment/Statistics.html +568 -0
  27. data/doc/BigBench/PostProcessor/Graphs.html +270 -0
  28. data/doc/BigBench/PostProcessor/Graphs/LineGraph.html +403 -0
  29. data/doc/BigBench/PostProcessor/Graphs/PieGraph.html +396 -0
  30. data/doc/BigBench/PostProcessor/InvalidProcessor.html +25 -1
  31. data/doc/BigBench/PostProcessor/Processor.html +59 -7
  32. data/doc/BigBench/PostProcessor/Statistics.html +26 -2
  33. data/doc/BigBench/PostProcessor/Test.html +26 -2
  34. data/doc/BigBench/Runner.html +24 -0
  35. data/doc/BigBench/Runner/NoBenchmarksDefined.html +24 -0
  36. data/doc/BigBench/Store.html +24 -0
  37. data/doc/BigBench/Tracker.html +24 -0
  38. data/doc/BigBench/Tracker/Tracker.html +24 -0
  39. data/doc/EventMachineLoop.html +24 -0
  40. data/doc/Float.html +24 -0
  41. data/doc/Gemfile.html +24 -0
  42. data/doc/Helpers.html +78 -0
  43. data/doc/Object.html +29 -0
  44. data/doc/README_rdoc.html +803 -0
  45. data/doc/Rakefile.html +66 -10
  46. data/doc/created.rid +46 -40
  47. data/doc/index.html +667 -1
  48. data/doc/js/search_index.js +1 -1
  49. data/doc/lib/bigbench/help/executor_txt.html +32 -2
  50. data/doc/rdoc.css +4 -0
  51. data/doc/table_of_contents.html +179 -23
  52. data/doc/test_rdoc.html +159 -0
  53. data/lib/bigbench.rb +2 -0
  54. data/lib/bigbench/executor.rb +17 -1
  55. data/lib/bigbench/help/executor.txt +5 -0
  56. data/lib/bigbench/post_processor.rb +16 -32
  57. data/lib/bigbench/post_processor/environment.rb +525 -0
  58. data/lib/bigbench/post_processor/graphs.rb +209 -0
  59. data/lib/bigbench/post_processor/statistics.rb +29 -49
  60. data/lib/bigbench/version.rb +1 -1
  61. data/spec/executor_spec.rb +35 -0
  62. data/spec/helpers.rb +15 -1
  63. data/spec/post_processor_spec.rb +19 -4
  64. data/spec/post_processors/environment_spec.rb +412 -0
  65. data/spec/post_processors/graphs_spec.rb +23 -0
  66. data/spec/post_processors/statistics_spec.rb +3 -2
  67. data/spec/tests/local.rb +1 -1
  68. data/spec/tests/sample_results_big.ljson +51925 -0
  69. data/spec/tests/sample_results_small.ljson +3875 -0
  70. data/spec/tests/with_post_processor.ljson +43 -0
  71. data/spec/tests/with_post_processor.rb +12 -0
  72. data/spec/tmp/.DS_Store +0 -0
  73. data/spec/tracker_spec.rb +8 -8
  74. metadata +61 -101
data/.DS_Store ADDED
Binary file
data/README.textile CHANGED
@@ -1,6 +1,15 @@
1
1
  h1. BigBench
2
2
 
3
- BigBench is a http penetration tool. It allows you to test the performance of any web server with very high loads.
3
+ BigBench is a http penetration tool. It allows you to test the performance of any web server with very high loads. It:
4
+
5
+ * Is a fancy ruby solution for local and remote load benchmarking
6
+ * Creates about 16% more load then Apache's JMeter
7
+ * Has an own very easy to use DSL
8
+ * Makes remote testing a breeze with bots
9
+ * Offers an awesome post processor environment to analyze your benchmarks that includes @tracking iteration@, @polynomial regressions@, @normal distributions@, ...
10
+ * Offers the ability to hook in and execute any code after the benchmarks are finished
11
+ * Comes with included post processors that create statistics and graphs
12
+ * Is very easy to extend!
4
13
 
5
14
  h3. Installation
6
15
 
@@ -8,8 +17,7 @@ bc.. gem install bigbench
8
17
 
9
18
  h3. Further Reading
10
19
 
11
- * "BigBench Website":http://southdesign.github.com/bigbench
12
- * "BigBench RDoc":http://southdesign.github.com/bigbench/doc/BigBench.html
20
+ * "BigBench RDoc":http://southdesign.github.com/bigbench
13
21
 
14
22
  h3. Requirements
15
23
 
@@ -122,7 +130,7 @@ bc.. module BigBench
122
130
  module PostProcessor
123
131
  module SamplePostProcessor
124
132
 
125
- def self.run!
133
+ def self.run!(options)
126
134
  # Do whatever you want here
127
135
  end
128
136
 
@@ -136,6 +144,225 @@ bc.. post_process :sample_post_processor
136
144
  # or
137
145
  post_process BigBench::PostProcessor::SamplePostProcessor
138
146
 
147
+ h3. Post Processor Environment
148
+
149
+ Post processors by default offer a great load of functionality that helps to evaluate the benchmarks. The available methods are:
150
+
151
+ h4. each_tracking
152
+
153
+ Iterate over each of the tracking elements. The trackings are read line-by-line. This is the fastest approach and should be used for huge datasets because the trackings are not loaded completely into memory.
154
+
155
+ bc.. total_trackings, total_errors = 0, 0
156
+ each_tracking do |tracking|
157
+ total_trackings += 1
158
+ total_errors += 1 unless tracking[:status] == 200
159
+ end
160
+
161
+ h4. trackings
162
+
163
+ An array with all tracking hashes in it. The creation might take some time at the first usage, afterwards the array is cached automatically.
164
+
165
+ bc.. trackings.size # => 650456
166
+ trackings.each do |tracking|
167
+ puts tracking[:duration]
168
+ end
169
+
170
+ h4. statistics
171
+
172
+ Computes the default statistics for any attribute
173
+
174
+ bc.. # Unclustered statistics
175
+ statistics.durations.max # => 78.2
176
+ statistics.durations.min # => 12.3
177
+
178
+ statistics.durations.mean # => 45.2
179
+ statistics.durations.average # => 45.2
180
+
181
+ statistics.durations.standard_deviation # => 11.3
182
+ statistics.durations.sd # => 11.3
183
+
184
+ statistics.durations.squared_deviation # => 60.7
185
+ statistics.durations.variance # => 60.7
186
+
187
+ # Time clustered statistics - 1.second
188
+ statistics.requests.max # => 42.1
189
+ statistics.requests.min # => 12.3
190
+ statistics.methods(:get).max # => 42.1
191
+ statistics.methods(:get).average # => 33.1
192
+ statistics.benchmark("index page").average # => 32.9
193
+ statistics.paths("/").average # => 12.5
194
+
195
+ h4. cluster
196
+
197
+ Clusters the resulting trackings by a timebase. The default timebase is @1.second@ which means, that it groups all trackings to full seconds and calculates the amount of requests and the average duration.
198
+
199
+ bc.. # Duration is 120 seconds for this example
200
+
201
+ # 1.second
202
+ cluster.timesteps # => [1, 2, ..., 120]
203
+ cluster.durations # => [43, 96, ..., 41]
204
+ cluster.requests # => [503, 541, ..., 511]
205
+ cluster.methods(:get) # => [200, 204, ..., 209]
206
+ cluster.methods(:post) # => [201, 102, ..., 401]
207
+ cluster.statuses(200) # => [501, 502, ..., 102]
208
+ cluster.statuses(404) # => [3, 1, ..., 0]
209
+ cluster.paths("/") # => [401, 482, ..., 271]
210
+ cluster.paths("/logout") # => [56, 51, ..., 38]
211
+ cluster.benchmark("index") # => [342, 531, ..., 234]
212
+ cluster.benchmark("user") # => [22, 41, ..., 556]
213
+
214
+ # 1.minute
215
+ cluster(1.minute).timesteps # => [0, 1]
216
+ cluster(1.minute).durations # => [42, 44]
217
+ cluster(1.minute).requests # => [24032, 21893]
218
+ cluster(1.minute).methods(:get) # => [200, 204]
219
+ cluster(1.minute).statuses(200) # => [501, 502]
220
+ cluster(1.minute).paths("/") # => [401, 482]
221
+ cluster(1.minute).benchmark("user") # => [22, 41]
222
+
223
+ # 30.seconds
224
+ cluster(30.seconds).timesteps # => [0, 1, 2, 3]
225
+ cluster(30.seconds).durations # => [42, 44, 41, 40]
226
+ cluster(30.seconds).requests # => [11023, 10234, 12345, 13789]
227
+ cluster(30.seconds).methods(:get) # => [200, 204, 34, 124]
228
+ cluster(30.seconds).statuses(200) # => [501, 502, 243, 57]
229
+ cluster(30.seconds).paths("/") # => [401, 482, 124, 234]
230
+ cluster(30.seconds).benchmark("user") # => [22, 41, 12, 51]
231
+
232
+ h4. appearing
233
+
234
+ Lists the unique attribute values that appeared in all trackings or the selected tracking scope.
235
+
236
+ bc.. appearing.statuses # => [200, 404]
237
+ appearing.methods # => ["get", "post"]
238
+ appearing.paths # => ["/", "/basic/auth"
239
+
240
+ h4. polynomial_regression
241
+
242
+ The polynomial regression creates a function that tries to map the test data best. With this function you have the ability do derivate and thereby plot the changes of the tested system over time. The degree of the regression can be freely chosen.
243
+
244
+ bc.. # Linear regression by default
245
+ polynomial_regression.durations.x # => [1, 2, ..., 120]
246
+ polynomial_regression.durations.y # => [45, 23, ..., 36]
247
+ polynomial_regression.requests.y # => [43, 45, ..., 62]
248
+ polynomial_regression.methods(:get).y # => [23, 62, ..., 23]
249
+ polynomial_regression.statuses(200).y # => [51, 22, ..., 15]
250
+ polynomial_regression.paths("/").y # => [78, 12, ..., 63]
251
+ polynomial_regression.benchmarks("index page").y # => [12, 45, ..., 23]
252
+ polynomial_regression.durations.degree # => 1
253
+ polynomial_regression.durations.formula # => "43.00886000234 + 0.0167548964060689x^1"
254
+
255
+ # 1. Derivation
256
+ polynomial_regression.durations.derivation(1) # => [0.01, 0.01, ..., 0.01]
257
+ polynomial_regression.requests.derivation(1) # => [405, 405, ..., 406]
258
+ polynomial_regression.methods(:get).derivation(1) # => [23, 62, ..., 23]
259
+ polynomial_regression.statuses(200).derivation(1) # => [51, 22, ..., 15]
260
+ polynomial_regression.paths("/").derivation(1) # => [78, 12, ..., 63]
261
+ polynomial_regression.benchmarks("index page").derivation(1) # => [12, 45, ..., 23]
262
+ polynomial_regression.durations.formula(1) # => "0.0167548964060689"
263
+
264
+ # Quadratic regression
265
+ polynomial_regression(:degree => 2).requests.x # => [1, 2, ..., 120]
266
+ polynomial_regression(:degree => 2).durations.y # => [43, 41, ..., 44]
267
+ polynomial_regression(:degree => 2).requests.y # => [43, 41, ..., 44]
268
+ polynomial_regression(:degree => 2).methods(:get).y # => [23, 62, ..., 23]
269
+ polynomial_regression(:degree => 2).statuses(200).y # => [51, 22, ..., 15]
270
+ polynomial_regression(:degree => 2).paths("/").y # => [78, 12, ..., 63]
271
+ polynomial_regression(:degree => 2).benchmarks("index page").y # => [12, 45, ..., 23]
272
+ polynomial_regression(:degree => 2).requests.formula # => "33.00886000234 + 0.0167548964060689x^1 + 0.0167548964060689x^2"
273
+
274
+ # Different timebase clustering
275
+ polynomial_regression(:degree => 2, :timebase => 1.minute).requests.x # => [0, 1]
276
+ polynomial_regression(:degree => 2, :timebase => 1.minute).requests.y # => [24032, 21893]
277
+ polynomial_regression(:degree => 2, :timebase => 1.minute).durations.y # => [43, 41]
278
+ polynomial_regression(:degree => 2, :timebase => 1.minute).requests.y # => [43, 41]
279
+ polynomial_regression(:degree => 2, :timebase => 1.minute).methods(:get).y # => [23, 62]
280
+ polynomial_regression(:degree => 2, :timebase => 1.minute).statuses(200).y # => [51, 22]
281
+ polynomial_regression(:degree => 2, :timebase => 1.minute).paths("/").y # => [78, 12]
282
+ polynomial_regression(:degree => 2, :timebase => 1.minute).benchmarks("index page").y # => [12, 45]
283
+
284
+ h4. normal_distribution
285
+
286
+ The normal distribution method creates a Gaussian bell function that visualizes the distribution of a special attribute. If you want to know if all your requests take about the same time, or if they vary a lot this is method to use. The x-values are automatically scaled to 4-times the variance around the mean, so it should map the whole bell all the time.
287
+
288
+ bc.. # Normal distribution without time clustering
289
+ normal_distribution.durations.x # => [1, 2, ..., 120]
290
+ normal_distribution.durations.y # => [45, 23, ..., 36]
291
+ normal_distribution.durations.formula # => "(1 / (10.242257627240862 * sqrt(2*PI))) * exp(-1 * ((x - 2.04671984377919)^2) / (2*10.242257627240862))"
292
+
293
+ # Normal distribution with default time slicing of 1.second
294
+ normal_distribution.requests.y # => [43, 45, ..., 62]
295
+ normal_distribution.methods(:get).y # => [23, 62, ..., 23]
296
+ normal_distribution.statuses(200).y # => [51, 22, ..., 15]
297
+ normal_distribution.paths("/").y # => [78, 12, ..., 63]
298
+ normal_distribution.benchmarks("index page").y # => [12, 45, ..., 23]
299
+
300
+ # Normal distribution with custom time slicing
301
+ normal_distribution(1.minute).requests.y # => [43, 45, ..., 62]
302
+ normal_distribution(1.minute).methods(:get).y # => [23, 62, ..., 23]
303
+ normal_distribution(1.minute).statuses(200).y # => [51, 22, ..., 15]
304
+ normal_distribution(1.minute).paths("/").y # => [78, 12, ..., 63]
305
+ normal_distribution(1.minute).benchmarks("index page").y # => [12, 45, ..., 23]
306
+
307
+ h4. scope_to_benchmark
308
+
309
+ The scope_to_benchmark method lets you scope any result to a single benchmark. The values computed in this block have entirely been created by this benchmark.
310
+
311
+ bc.. # Results for the index page benchmark
312
+ scope_to_benchmark "index page" do
313
+ cluster.durations # => [43, 96, ..., 41]
314
+ cluster.requests # => [503, 541, ..., 511]
315
+ cluster.methods(:get) # => [200, 204, ..., 209]
316
+ cluster.methods(:post) # => [201, 102, ..., 401]
317
+ polynomial_regression.durations.x # => [1, 2, ..., 120]
318
+ polynomial_regression.durations.y # => [45, 23, ..., 36]
319
+ normal_distribution.requests.y # => [43, 45, ..., 62]
320
+ normal_distribution.methods(:get).y # => [23, 62, ..., 23]
321
+ normal_distribution.statuses(200).y # => [51, 22, ..., 15]
322
+ end
323
+
324
+ # Results for the login and logout benchmark
325
+ scope_to_benchmark "login and logout" do
326
+ cluster.durations # => [43, 96, ..., 41]
327
+ cluster.requests # => [300, 141, ..., 511]
328
+ cluster.methods(:get) # => [100, 204, ..., 209]
329
+ cluster.methods(:post) # => [101, 102, ..., 401]
330
+ polynomial_regression.durations.x # => [1, 2, ..., 120]
331
+ polynomial_regression.durations.y # => [45, 23, ..., 36]
332
+ normal_distribution.requests.y # => [43, 45, ..., 62]
333
+ normal_distribution.methods(:get).y # => [23, 62, ..., 23]
334
+ normal_distribution.statuses(200).y # => [51, 22, ..., 15]
335
+ end
336
+
337
+ h4. each_benchmark
338
+
339
+ Iterates over all benchmarks and automatically scopes the results at each iteration to the current benchmark. This is useful if you want to access the detailed differences of each benchmark.
340
+
341
+ bc.. # Iterate over all benchmarks and calculate the results
342
+ each_benchmark do |benchmark|
343
+ benchmark.name # => "index page" then "login and logout"
344
+
345
+ cluster.durations # => [43, 96, ..., 41]
346
+ cluster.requests # => [300, 141, ..., 511]
347
+ cluster.methods(:get) # => [100, 204, ..., 209]
348
+ cluster.methods(:post) # => [101, 102, ..., 401]
349
+ polynomial_regression.durations.x # => [1, 2, ..., 120]
350
+ polynomial_regression.durations.y # => [45, 23, ..., 36]
351
+ normal_distribution.requests.y # => [43, 45, ..., 62]
352
+ normal_distribution.methods(:get).y # => [23, 62, ..., 23]
353
+ normal_distribution.statuses(200).y # => [51, 22, ..., 15]
354
+ end
355
+
356
+ h3. Running Post Processors separately
357
+
358
+ You can also re-run the currently defined post processors or run a separate post processor you never even defined in the first place without collecting the test data again like this:
359
+
360
+ bc.. # Re-run the postprocessors defined in example.rb
361
+ bigbench run postprocessors example.rb
362
+
363
+ # Run a separate post processor independently - the already defined post processors are ignored
364
+ bigbench run postprocessor example.rb statistics
365
+
139
366
  p. Contribute, create great post processors and send me a pull request!
140
367
 
141
368
  h3. Statistics
@@ -198,6 +425,29 @@ h3. Test Results
198
425
 
199
426
  h2. Version History
200
427
 
428
+ h3. 0.4
429
+
430
+ * Added command line tool to run the post processors again
431
+ * Added command line tool to run any post processor on already collected data
432
+ * Pimped the post processor environment. Available functions now include:
433
+ * trackings array is now available with all hashes of the trackings at once
434
+ * *Clustering by any timebase*, e.g. @1.second@, @20.seconds@, or @2.minutes@ which automatically calculates these values per time slice:
435
+ ** @average duration@
436
+ ** @requests@
437
+ ** @methods(:get, :post, :put, ...)@
438
+ ** @statuses(200, 404, 403, ...)@
439
+ ** @paths("/", "/logout", "/login", ...)@
440
+ ** @benchmarks("index page", "user behavior", "bot crawling", ...)@
441
+ * *Polynomial Regression of any Degree* for all attributes including the derivatives and a formula printer
442
+ * *Statistics* with the following values for all attributes:
443
+ ** @max@
444
+ ** @min@
445
+ ** @mean@
446
+ ** @standard_deviation@
447
+ ** @squared_deviation@ or @variance@
448
+ * *Gaussian Normal Distribution* for all attributes including a *formula printer*
449
+ * *Appearing* method to quickly list all appearing @statuses@, @methods@, @paths@ in the test results
450
+
201
451
  h3. 0.3
202
452
 
203
453
  * Added post processors hook that run after the benchmark with a simple plugin structure
data/Rakefile CHANGED
@@ -1,17 +1,51 @@
1
1
  require "bundler/gem_tasks"
2
2
  require "rack"
3
+ require "RedCloth"
4
+ require "redcloth-formatters-rdoc"
5
+ require "rdoc/task"
3
6
 
4
- namespace :bigbench do
7
+
8
+ desc "Create and open documentation"
9
+ task :doc do
5
10
 
6
- desc "Create and open documentation"
7
- task :doc do
8
- `rdoc --main BigBench --include lib/bigbench/help/ && open doc/index.html`
9
- end
11
+ # Compile the readme to the rdoc format
12
+ readme_textile = File.open('README.textile', 'r+'){ |file| file.read }
13
+ readme_rdoc = RedCloth.new(readme_textile).to_rdoc
14
+ File.open('README.rdoc', 'w+'){ |file| file.write(readme_rdoc) }
10
15
 
11
- desc "Start Thin RDoc Testserver"
12
- task :testserver do
13
- load "spec/lib/test_web_server.rb"
14
- Rack::Handler::Thin.run Sinatra::Application, :Port => 3001
16
+ # Create rdoc with the readme as main file
17
+ `rdoc --main README.rdoc --include lib/bigbench/help/`
18
+
19
+ RDoc::Task.new do |rdoc|
20
+ rdoc.main = "README.rdoc"
21
+ rdoc.rdoc_files.include("README.rdoc", "lib/bigbench/help/")
15
22
  end
16
23
 
24
+ # Fix RDocs inability to handle tables
25
+ index_html = File.open('doc/index.html', 'r+'){ |file| file.read }
26
+ index_html.gsub! '&lt;', '<'
27
+ index_html.gsub! '&gt;', '>'
28
+ index_html.gsub! '<p><table></p>', '<table>'
29
+ index_html.gsub! '<pre><tr>', '<tr>'
30
+ index_html.gsub! '</tr></pre>', '</tr>'
31
+ index_html.gsub! '<p></table></p>', '</table>'
32
+ File.open('doc/index.html', 'w+'){ |file| file.write(index_html) }
33
+
34
+ # Add table style
35
+ rdoc_css = File.open('doc/rdoc.css', 'r+'){ |file| file.read }
36
+ rdoc_css += "\n table{ border: 1px dashed #D3D3D3; line-height: 30px; margin-top: 10px; border-collapse: collapse; }"
37
+ rdoc_css += "\n td{ padding-left:20px; padding-right:20px; border-top: 1px solid #E4E4E4; }"
38
+ rdoc_css += "\n th{ padding-left:20px; padding-right:20px; text-align:left; }"
39
+ File.open('doc/rdoc.css', 'w+'){ |file| file.write(rdoc_css) }
40
+
41
+ # Clean up the rdoc file
42
+ File.delete("README.rdoc")
43
+ `open doc/index.html`
44
+
45
+ end
46
+
47
+ desc "Start Thin RDoc Testserver"
48
+ task :server do
49
+ load "spec/lib/test_web_server.rb"
50
+ Rack::Handler::Thin.run Sinatra::Application, :Port => 3001
17
51
  end
data/doc/Array.html ADDED
@@ -0,0 +1,288 @@
1
+ <!DOCTYPE html>
2
+
3
+ <html>
4
+ <head>
5
+ <meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
6
+
7
+ <title>class Array - RDoc Documentation</title>
8
+
9
+ <link type="text/css" media="screen" href="./rdoc.css" rel="stylesheet">
10
+
11
+ <script type="text/javascript">
12
+ var rdoc_rel_prefix = "./";
13
+ </script>
14
+
15
+ <script type="text/javascript" charset="utf-8" src="./js/jquery.js"></script>
16
+ <script type="text/javascript" charset="utf-8" src="./js/navigation.js"></script>
17
+ <script type="text/javascript" charset="utf-8" src="./js/search_index.js"></script>
18
+ <script type="text/javascript" charset="utf-8" src="./js/search.js"></script>
19
+ <script type="text/javascript" charset="utf-8" src="./js/searcher.js"></script>
20
+ <script type="text/javascript" charset="utf-8" src="./js/darkfish.js"></script>
21
+
22
+
23
+ <body id="top" class="class">
24
+ <nav id="metadata">
25
+ <nav id="home-section" class="section">
26
+ <h3 class="section-header">
27
+ <a href="./index.html">Home</a>
28
+ <a href="./table_of_contents.html#classes">Classes</a>
29
+ <a href="./table_of_contents.html#methods">Methods</a>
30
+ </h3>
31
+ </nav>
32
+
33
+
34
+ <nav id="search-section" class="section project-section" class="initially-hidden">
35
+ <form action="#" method="get" accept-charset="utf-8">
36
+ <h3 class="section-header">
37
+ <input type="text" name="search" placeholder="Search" id="search-field"
38
+ title="Type to search, Up and Down to navigate, Enter to load">
39
+ </h3>
40
+ </form>
41
+
42
+ <ul id="search-results" class="initially-hidden"></ul>
43
+ </nav>
44
+
45
+
46
+ <div id="file-metadata">
47
+ <nav id="file-list-section" class="section">
48
+ <h3 class="section-header">Defined In</h3>
49
+ <ul>
50
+ <li>lib/bigbench/post_processor/environment.rb
51
+ </ul>
52
+ </nav>
53
+
54
+
55
+ </div>
56
+
57
+ <div id="class-metadata">
58
+
59
+ <nav id="parent-class-section" class="section">
60
+ <h3 class="section-header">Parent</h3>
61
+
62
+ <p class="link"><a href="Object.html">Object</a>
63
+
64
+ </nav>
65
+
66
+
67
+ <!-- Method Quickref -->
68
+ <nav id="method-list-section" class="section">
69
+ <h3 class="section-header">Methods</h3>
70
+
71
+ <ul class="link-list">
72
+
73
+ <li><a href="#method-i-average">#average</a>
74
+
75
+ <li><a href="#method-i-sum">#sum</a>
76
+
77
+ </ul>
78
+ </nav>
79
+
80
+ </div>
81
+
82
+ <div id="project-metadata">
83
+ <nav id="fileindex-section" class="section project-section">
84
+ <h3 class="section-header">Pages</h3>
85
+
86
+ <ul>
87
+
88
+ <li class="file"><a href="./Gemfile.html">Gemfile</a>
89
+
90
+ <li class="file"><a href="./README_rdoc.html">README</a>
91
+
92
+ <li class="file"><a href="./Rakefile.html">Rakefile</a>
93
+
94
+ <li class="file"><a href="./lib/bigbench/help/executor_txt.html">executor</a>
95
+
96
+ </ul>
97
+ </nav>
98
+
99
+ <nav id="classindex-section" class="section project-section">
100
+ <h3 class="section-header">Class and Module Index</h3>
101
+
102
+ <ul class="link-list">
103
+
104
+ <li><a href="./BigBench.html">BigBench</a>
105
+
106
+ <li><a href="./BigBench/Benchmark.html">BigBench::Benchmark</a>
107
+
108
+ <li><a href="./BigBench/Benchmark/Benchmark.html">BigBench::Benchmark::Benchmark</a>
109
+
110
+ <li><a href="./BigBench/Benchmark/Looper.html">BigBench::Benchmark::Looper</a>
111
+
112
+ <li><a href="./BigBench/Bot.html">BigBench::Bot</a>
113
+
114
+ <li><a href="./BigBench/Configuration.html">BigBench::Configuration</a>
115
+
116
+ <li><a href="./BigBench/Configuration/Config.html">BigBench::Configuration::Config</a>
117
+
118
+ <li><a href="./BigBench/Configuration/InvalidOptions.html">BigBench::Configuration::InvalidOptions</a>
119
+
120
+ <li><a href="./BigBench/Executor.html">BigBench::Executor</a>
121
+
122
+ <li><a href="./BigBench/Executor/InvalidCommand.html">BigBench::Executor::InvalidCommand</a>
123
+
124
+ <li><a href="./BigBench/Fragment.html">BigBench::Fragment</a>
125
+
126
+ <li><a href="./BigBench/Fragment/Fragment.html">BigBench::Fragment::Fragment</a>
127
+
128
+ <li><a href="./BigBench/Output.html">BigBench::Output</a>
129
+
130
+ <li><a href="./BigBench/PostProcessor.html">BigBench::PostProcessor</a>
131
+
132
+ <li><a href="./BigBench/PostProcessor/Environment.html">BigBench::PostProcessor::Environment</a>
133
+
134
+ <li><a href="./BigBench/PostProcessor/Environment/Appearings.html">BigBench::PostProcessor::Environment::Appearings</a>
135
+
136
+ <li><a href="./BigBench/PostProcessor/Environment/AttributeCluster.html">BigBench::PostProcessor::Environment::AttributeCluster</a>
137
+
138
+ <li><a href="./BigBench/PostProcessor/Environment/BenchmarkNotFound.html">BigBench::PostProcessor::Environment::BenchmarkNotFound</a>
139
+
140
+ <li><a href="./BigBench/PostProcessor/Environment/Cluster.html">BigBench::PostProcessor::Environment::Cluster</a>
141
+
142
+ <li><a href="./BigBench/PostProcessor/Environment/NormalDistribution.html">BigBench::PostProcessor::Environment::NormalDistribution</a>
143
+
144
+ <li><a href="./BigBench/PostProcessor/Environment/PolynomialRegression.html">BigBench::PostProcessor::Environment::PolynomialRegression</a>
145
+
146
+ <li><a href="./BigBench/PostProcessor/Environment/Statistics.html">BigBench::PostProcessor::Environment::Statistics</a>
147
+
148
+ <li><a href="./BigBench/PostProcessor/Graphs.html">BigBench::PostProcessor::Graphs</a>
149
+
150
+ <li><a href="./BigBench/PostProcessor/Graphs/LineGraph.html">BigBench::PostProcessor::Graphs::LineGraph</a>
151
+
152
+ <li><a href="./BigBench/PostProcessor/Graphs/PieGraph.html">BigBench::PostProcessor::Graphs::PieGraph</a>
153
+
154
+ <li><a href="./BigBench/PostProcessor/InvalidProcessor.html">BigBench::PostProcessor::InvalidProcessor</a>
155
+
156
+ <li><a href="./BigBench/PostProcessor/Processor.html">BigBench::PostProcessor::Processor</a>
157
+
158
+ <li><a href="./BigBench/PostProcessor/Statistics.html">BigBench::PostProcessor::Statistics</a>
159
+
160
+ <li><a href="./BigBench/PostProcessor/Test.html">BigBench::PostProcessor::Test</a>
161
+
162
+ <li><a href="./BigBench/Runner.html">BigBench::Runner</a>
163
+
164
+ <li><a href="./BigBench/Runner/NoBenchmarksDefined.html">BigBench::Runner::NoBenchmarksDefined</a>
165
+
166
+ <li><a href="./BigBench/Store.html">BigBench::Store</a>
167
+
168
+ <li><a href="./BigBench/Tracker.html">BigBench::Tracker</a>
169
+
170
+ <li><a href="./BigBench/Tracker/Tracker.html">BigBench::Tracker::Tracker</a>
171
+
172
+ <li><a href="./Array.html">Array</a>
173
+
174
+ <li><a href="./EventMachineLoop.html">EventMachineLoop</a>
175
+
176
+ <li><a href="./Float.html">Float</a>
177
+
178
+ <li><a href="./Helpers.html">Helpers</a>
179
+
180
+ <li><a href="./Object.html">Object</a>
181
+
182
+ </ul>
183
+ </nav>
184
+
185
+ </div>
186
+ </nav>
187
+
188
+ <div id="documentation">
189
+ <h1 class="class">class Array</h1>
190
+
191
+ <div id="description" class="description">
192
+
193
+ <p>Adding the sum and average methods to the default array</p>
194
+
195
+ </div><!-- description -->
196
+
197
+
198
+
199
+
200
+ <section id="5Buntitled-5D" class="documentation-section">
201
+
202
+
203
+
204
+
205
+
206
+
207
+
208
+
209
+ <!-- Methods -->
210
+
211
+ <section id="public-instance-5Buntitled-5D-method-details" class="method-section section">
212
+ <h3 class="section-header">Public Instance Methods</h3>
213
+
214
+
215
+ <div id="method-i-average" class="method-detail ">
216
+
217
+ <div class="method-heading">
218
+ <span class="method-name">average</span><span
219
+ class="method-args">()</span>
220
+ <span class="method-click-advice">click to toggle source</span>
221
+ </div>
222
+
223
+
224
+ <div class="method-description">
225
+
226
+
227
+
228
+
229
+
230
+ <div class="method-source-code" id="average-source">
231
+ <pre><span class="ruby-comment"># File lib/bigbench/post_processor/environment.rb, line 22</span>
232
+ <span class="ruby-keyword">def</span> <span class="ruby-identifier">average</span>
233
+ <span class="ruby-identifier">result</span> = <span class="ruby-identifier">sum</span> <span class="ruby-operator">/</span> <span class="ruby-identifier">size</span>.<span class="ruby-identifier">to_f</span>
234
+ <span class="ruby-identifier">result</span>.<span class="ruby-identifier">nan?</span> <span class="ruby-operator">?</span> <span class="ruby-value">0</span> <span class="ruby-operator">:</span> <span class="ruby-identifier">result</span>
235
+ <span class="ruby-keyword">end</span></pre>
236
+ </div><!-- average-source -->
237
+
238
+ </div>
239
+
240
+
241
+
242
+
243
+ </div><!-- average-method -->
244
+
245
+
246
+ <div id="method-i-sum" class="method-detail ">
247
+
248
+ <div class="method-heading">
249
+ <span class="method-name">sum</span><span
250
+ class="method-args">()</span>
251
+ <span class="method-click-advice">click to toggle source</span>
252
+ </div>
253
+
254
+
255
+ <div class="method-description">
256
+
257
+
258
+
259
+
260
+
261
+ <div class="method-source-code" id="sum-source">
262
+ <pre><span class="ruby-comment"># File lib/bigbench/post_processor/environment.rb, line 18</span>
263
+ <span class="ruby-keyword">def</span> <span class="ruby-identifier">sum</span>
264
+ <span class="ruby-identifier">reduce</span>(<span class="ruby-value">:+</span>).<span class="ruby-identifier">to_f</span>
265
+ <span class="ruby-keyword">end</span></pre>
266
+ </div><!-- sum-source -->
267
+
268
+ </div>
269
+
270
+
271
+
272
+
273
+ </div><!-- sum-method -->
274
+
275
+
276
+ </section><!-- public-instance-method-details -->
277
+
278
+ </section><!-- 5Buntitled-5D -->
279
+
280
+ </div><!-- documentation -->
281
+
282
+
283
+ <footer id="validator-badges">
284
+ <p><a href="http://validator.w3.org/check/referer">[Validate]</a>
285
+ <p>Generated by <a href="https://github.com/rdoc/rdoc">RDoc</a> 3.12.
286
+ <p>Generated with the <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish Rdoc Generator</a> 3.
287
+ </footer>
288
+