bigbench 0.0.2 → 0.0.3
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/README.textile +103 -2
- data/bigbench.gemspec +5 -2
- data/doc/BigBench.html +167 -4
- data/doc/BigBench/Benchmark.html +12 -0
- data/doc/BigBench/Benchmark/Benchmark.html +12 -0
- data/doc/BigBench/Benchmark/Looper.html +12 -0
- data/doc/BigBench/Bot.html +12 -0
- data/doc/BigBench/Configuration.html +12 -0
- data/doc/BigBench/Configuration/Config.html +12 -0
- data/doc/BigBench/Configuration/InvalidOptions.html +12 -0
- data/doc/BigBench/Executor.html +12 -0
- data/doc/BigBench/Executor/InvalidCommand.html +12 -0
- data/doc/BigBench/Fragment.html +12 -0
- data/doc/BigBench/Fragment/Fragment.html +13 -1
- data/doc/BigBench/Output.html +12 -0
- data/doc/BigBench/PostProcessor.html +378 -0
- data/doc/BigBench/PostProcessor/Environment.html +243 -0
- data/doc/BigBench/PostProcessor/InvalidProcessor.html +231 -0
- data/doc/BigBench/PostProcessor/Processor.html +306 -0
- data/doc/BigBench/PostProcessor/Statistics.html +225 -0
- data/doc/BigBench/PostProcessor/Test.html +223 -0
- data/doc/BigBench/Runner.html +12 -0
- data/doc/BigBench/Runner/NoBenchmarksDefined.html +12 -0
- data/doc/BigBench/Store.html +12 -0
- data/doc/BigBench/Tracker.html +12 -0
- data/doc/BigBench/Tracker/Tracker.html +12 -0
- data/doc/EventMachineLoop.html +12 -0
- data/doc/Float.html +12 -0
- data/doc/Gemfile.html +12 -0
- data/doc/Helpers.html +12 -0
- data/doc/Object.html +12 -0
- data/doc/Rakefile.html +23 -9
- data/doc/created.rid +40 -36
- data/doc/index.html +12 -0
- data/doc/js/search_index.js +1 -1
- data/doc/lib/bigbench/help/executor_txt.html +12 -0
- data/doc/table_of_contents.html +62 -13
- data/lib/bigbench.rb +6 -3
- data/lib/bigbench/benchmark.rb +1 -2
- data/lib/bigbench/executor.rb +2 -0
- data/lib/bigbench/fragment.rb +1 -1
- data/lib/bigbench/post_processor.rb +206 -0
- data/lib/bigbench/post_processor/statistics.rb +123 -0
- data/lib/bigbench/version.rb +1 -1
- data/spec/helpers.rb +1 -0
- data/spec/post_processor_spec.rb +71 -0
- data/spec/post_processors/statistics_spec.rb +14 -0
- data/spec/tests/result.ljson +43 -0
- metadata +147 -30
data/doc/created.rid
CHANGED
@@ -1,36 +1,40 @@
|
|
1
|
-
|
2
|
-
./bin/bigbench
|
3
|
-
./dev/net_http.rb
|
4
|
-
./dev/test.rb
|
5
|
-
./dev/tracking.rb
|
6
|
-
./Gemfile
|
7
|
-
./lib/bigbench/benchmark/looper.rb
|
8
|
-
./lib/bigbench/benchmark.rb
|
9
|
-
./lib/bigbench/bot.rb
|
10
|
-
./lib/bigbench/configuration.rb Wed, 11 Apr 2012
|
11
|
-
./lib/bigbench/executor.rb
|
12
|
-
./lib/bigbench/float_extensions.rb
|
13
|
-
./lib/bigbench/fragment.rb
|
14
|
-
./lib/bigbench/help/executor.txt
|
15
|
-
./lib/bigbench/initializers.rb
|
16
|
-
./lib/bigbench/output.rb
|
17
|
-
./lib/bigbench/
|
18
|
-
./lib/bigbench/
|
19
|
-
./lib/bigbench/
|
20
|
-
./lib/bigbench/
|
21
|
-
./lib/bigbench.rb
|
22
|
-
./
|
23
|
-
./
|
24
|
-
./
|
25
|
-
./spec/
|
26
|
-
./spec/
|
27
|
-
./spec/
|
28
|
-
./spec/
|
29
|
-
./spec/
|
30
|
-
./spec/
|
31
|
-
./spec/
|
32
|
-
./spec/
|
33
|
-
./spec/
|
34
|
-
./spec/
|
35
|
-
./spec/
|
36
|
-
./spec/
|
1
|
+
Fri, 13 Apr 2012 00:06:48 +0200
|
2
|
+
./bin/bigbench Wed, 11 Apr 2012 22:00:15 +0200
|
3
|
+
./dev/net_http.rb Wed, 11 Apr 2012 22:00:15 +0200
|
4
|
+
./dev/test.rb Wed, 11 Apr 2012 22:00:15 +0200
|
5
|
+
./dev/tracking.rb Wed, 11 Apr 2012 22:00:15 +0200
|
6
|
+
./Gemfile Wed, 11 Apr 2012 22:00:15 +0200
|
7
|
+
./lib/bigbench/benchmark/looper.rb Wed, 11 Apr 2012 22:00:15 +0200
|
8
|
+
./lib/bigbench/benchmark.rb Thu, 12 Apr 2012 13:50:50 +0200
|
9
|
+
./lib/bigbench/bot.rb Wed, 11 Apr 2012 22:00:15 +0200
|
10
|
+
./lib/bigbench/configuration.rb Wed, 11 Apr 2012 22:00:15 +0200
|
11
|
+
./lib/bigbench/executor.rb Thu, 12 Apr 2012 14:38:40 +0200
|
12
|
+
./lib/bigbench/float_extensions.rb Wed, 11 Apr 2012 22:00:15 +0200
|
13
|
+
./lib/bigbench/fragment.rb Thu, 12 Apr 2012 17:20:03 +0200
|
14
|
+
./lib/bigbench/help/executor.txt Wed, 11 Apr 2012 22:00:15 +0200
|
15
|
+
./lib/bigbench/initializers.rb Wed, 11 Apr 2012 22:00:15 +0200
|
16
|
+
./lib/bigbench/output.rb Wed, 11 Apr 2012 22:00:15 +0200
|
17
|
+
./lib/bigbench/post_processor/statistics.rb Thu, 12 Apr 2012 22:50:26 +0200
|
18
|
+
./lib/bigbench/post_processor.rb Thu, 12 Apr 2012 23:13:41 +0200
|
19
|
+
./lib/bigbench/runner.rb Wed, 11 Apr 2012 22:00:15 +0200
|
20
|
+
./lib/bigbench/store.rb Wed, 11 Apr 2012 22:00:15 +0200
|
21
|
+
./lib/bigbench/tracker.rb Wed, 11 Apr 2012 22:00:15 +0200
|
22
|
+
./lib/bigbench/version.rb Thu, 12 Apr 2012 13:17:27 +0200
|
23
|
+
./lib/bigbench.rb Thu, 12 Apr 2012 21:28:21 +0200
|
24
|
+
./Rakefile Wed, 11 Apr 2012 22:00:15 +0200
|
25
|
+
./spec/benchmark_spec.rb Wed, 11 Apr 2012 22:00:15 +0200
|
26
|
+
./spec/bot_spec.rb Wed, 11 Apr 2012 22:00:15 +0200
|
27
|
+
./spec/configure_spec.rb Wed, 11 Apr 2012 22:00:15 +0200
|
28
|
+
./spec/executor_spec.rb Wed, 11 Apr 2012 22:00:15 +0200
|
29
|
+
./spec/fragment_spec.rb Wed, 11 Apr 2012 22:00:15 +0200
|
30
|
+
./spec/helpers.rb Thu, 12 Apr 2012 15:12:44 +0200
|
31
|
+
./spec/lib/test_web_server.rb Wed, 11 Apr 2012 22:00:15 +0200
|
32
|
+
./spec/looper_spec.rb Wed, 11 Apr 2012 22:00:15 +0200
|
33
|
+
./spec/post_processor_spec.rb Thu, 12 Apr 2012 16:01:49 +0200
|
34
|
+
./spec/post_processors/statistics_spec.rb Thu, 12 Apr 2012 21:36:43 +0200
|
35
|
+
./spec/runner_spec.rb Wed, 11 Apr 2012 22:00:15 +0200
|
36
|
+
./spec/store_spec.rb Wed, 11 Apr 2012 22:00:15 +0200
|
37
|
+
./spec/tests/local.rb Wed, 11 Apr 2012 22:00:15 +0200
|
38
|
+
./spec/tests/local_invalid.rb Wed, 11 Apr 2012 22:00:15 +0200
|
39
|
+
./spec/tracker_spec.rb Wed, 11 Apr 2012 22:00:15 +0200
|
40
|
+
./spec/webserver_spec.rb Wed, 11 Apr 2012 22:00:15 +0200
|
data/doc/index.html
CHANGED
@@ -89,6 +89,18 @@
|
|
89
89
|
|
90
90
|
<li><a href="./BigBench/Output.html">BigBench::Output</a>
|
91
91
|
|
92
|
+
<li><a href="./BigBench/PostProcessor.html">BigBench::PostProcessor</a>
|
93
|
+
|
94
|
+
<li><a href="./BigBench/PostProcessor/Environment.html">BigBench::PostProcessor::Environment</a>
|
95
|
+
|
96
|
+
<li><a href="./BigBench/PostProcessor/InvalidProcessor.html">BigBench::PostProcessor::InvalidProcessor</a>
|
97
|
+
|
98
|
+
<li><a href="./BigBench/PostProcessor/Processor.html">BigBench::PostProcessor::Processor</a>
|
99
|
+
|
100
|
+
<li><a href="./BigBench/PostProcessor/Statistics.html">BigBench::PostProcessor::Statistics</a>
|
101
|
+
|
102
|
+
<li><a href="./BigBench/PostProcessor/Test.html">BigBench::PostProcessor::Test</a>
|
103
|
+
|
92
104
|
<li><a href="./BigBench/Runner.html">BigBench::Runner</a>
|
93
105
|
|
94
106
|
<li><a href="./BigBench/Runner/NoBenchmarksDefined.html">BigBench::Runner::NoBenchmarksDefined</a>
|
data/doc/js/search_index.js
CHANGED
@@ -1 +1 @@
|
|
1
|
-
var search_data = {"index":{"searchIndex":["bigbench","benchmark","benchmark","looper","bot","configuration","config","invalidoptions","executor","invalidcommand","fragment","fragment","output","runner","nobenchmarksdefined","store","tracker","tracker","eventmachineloop","float","helpers","object","add()","add_option()","add_tracking()","all()","all_requests_done?()","authorized?()","benchmark()","benchmarks()","bot_is_checking()","bot_is_working()","bot_received_test_instructions()","bot_stopped_working()","bots()","check_config!()","check_test!()","config()","config()","configure=()","configure=()","count_trackings()","delete()","deployed_test()","done()","duration()","finished_bots_loop()","finished_running_benchmarks()","finished_writing_trackings()","get()","is_running?()","load_test!()","loaded_tests()","loop!()","max_duration()","message()","message()","message()","new()","new()","new()","new()","new()","new()","next_fragment()","parse()","pop_tracking()","post()","protected!()","put()","request!()","reset()","reset!()","reset!()","reset!()","reset!()","run!()","run!()","run!()","run!()","run!()","running?()","running_benchmarks()","running_bots_loop()","setup!()","start()","start()","starting_bots_loop()","stop()","test()","test=()","to_milliseconds()","track()","track!()","valid?()","write_local_trackings_to_file!()","write_store_trackings_to_file!()","write_trackings_to_store!()","writing_trackings()","wrote_trackings()","gemfile","rakefile","executor"],"longSearchIndex":["bigbench","bigbench::benchmark","bigbench::benchmark::benchmark","bigbench::benchmark::looper","bigbench::bot","bigbench::configuration","bigbench::configuration::config","bigbench::configuration::invalidoptions","bigbench::executor","bigbench::executor::invalidcommand","bigbench::fragment","bigbench::fragment::fragment","bigbench::output","bigbench::runner","bigbench::runner::nobenchmarksdefined","bigbench::store","bigbench::tracker","bigbench::tracker::tracker","eventmachineloop","float","helpers","object","bigbench::benchmark::add()","bigbench::configuration::config::add_option()","bigbench::store::add_tracking()","bigbench::benchmark::all()","eventmachineloop#all_requests_done?()","object#authorized?()","bigbench::benchmark()","bigbench::benchmarks()","bigbench::output::bot_is_checking()","bigbench::store::bot_is_working()","bigbench::output::bot_received_test_instructions()","bigbench::store::bot_stopped_working()","bigbench::store::bots()","bigbench::check_config!()","bigbench::bot::check_test!()","bigbench::config()","bigbench::configuration::config()","bigbench::configure=()","bigbench::configuration::configure=()","bigbench::store::count_trackings()","bigbench::fragment::delete()","bigbench::output::deployed_test()","bigbench::output::done()","bigbench::duration()","bigbench::output::finished_bots_loop()","bigbench::output::finished_running_benchmarks()","bigbench::output::finished_writing_trackings()","bigbench::fragment::get()","bigbench::benchmark::benchmark#is_running?()","bigbench::load_test!()","bigbench::output::loaded_tests()","bigbench::benchmark::looper#loop!()","bigbench::benchmark::max_duration()","bigbench::configuration::invalidoptions#message()","bigbench::executor::invalidcommand#message()","bigbench::runner::nobenchmarksdefined#message()","bigbench::benchmark::benchmark::new()","bigbench::benchmark::looper::new()","bigbench::configuration::config::new()","bigbench::fragment::fragment::new()","bigbench::tracker::tracker::new()","eventmachineloop::new()","bigbench::benchmark::looper#next_fragment()","bigbench::fragment::parse()","bigbench::store::pop_tracking()","bigbench::fragment::post()","object#protected!()","bigbench::fragment::put()","eventmachineloop#request!()","bigbench::output::reset()","bigbench::benchmark::reset!()","bigbench::configuration::reset!()","bigbench::fragment::reset!()","bigbench::store::reset!()","bigbench::run!()","bigbench::benchmark::benchmark#run!()","bigbench::executor::run!()","bigbench::fragment::fragment#run!()","bigbench::runner::run!()","bigbench::store::running?()","bigbench::output::running_benchmarks()","bigbench::output::running_bots_loop()","bigbench::store::setup!()","bigbench::output::start()","bigbench::store::start()","bigbench::output::starting_bots_loop()","bigbench::store::stop()","bigbench::store::test()","bigbench::store::test=()","float#to_milliseconds()","bigbench::tracker::tracker#track()","bigbench::fragment::fragment#track!()","bigbench::configuration::config#valid?()","bigbench::write_local_trackings_to_file!()","bigbench::write_store_trackings_to_file!()","bigbench::write_trackings_to_store!()","bigbench::output::writing_trackings()","bigbench::output::wrote_trackings()","","",""],"info":[["BigBench","","BigBench.html","",""],["BigBench::Benchmark","","BigBench/Benchmark.html","","<p>Holds the actual benchmark methods. A benchmark is a sequence of requests\nto the same server, but to …\n"],["BigBench::Benchmark::Benchmark","","BigBench/Benchmark/Benchmark.html","",""],["BigBench::Benchmark::Looper","","BigBench/Benchmark/Looper.html","",""],["BigBench::Bot","","BigBench/Bot.html","","<p>A bot is used for remote testing. It is running in the background of a\nmachine and waits for tests to …\n"],["BigBench::Configuration","","BigBench/Configuration.html","","<p>The configuration is configured in the test reciepts and looks like this:\n\n<pre>BigBench.configure = {\n :duration ...</pre>\n"],["BigBench::Configuration::Config","","BigBench/Configuration/Config.html","","<p>The main config object for BigBench. It allows config options to be added\nand forces some default values …\n"],["BigBench::Configuration::InvalidOptions","","BigBench/Configuration/InvalidOptions.html","","<p>Is returned if the configuration is not filled sufficiently\n"],["BigBench::Executor","","BigBench/Executor.html","","<p>Dispatches the command line commands to BigBench calls. Available commands\nare:\n<p>Usage:\n\n<pre># Local Testing ...</pre>\n"],["BigBench::Executor::InvalidCommand","","BigBench/Executor/InvalidCommand.html","","<p>Is thrown when the command is not known\n"],["BigBench::Fragment","","BigBench/Fragment.html","","<p>A fragment represents a single http request inside a benchmark. It is\nexecuted by the benchmark and resides …\n"],["BigBench::Fragment::Fragment","","BigBench/Fragment/Fragment.html","",""],["BigBench::Output","","BigBench/Output.html","","<p>This module is used to keep all the command line outputs in a single place.\nThe output module gets notified …\n"],["BigBench::Runner","","BigBench/Runner.html","","<p>The runner runs all available benchmarks and returns as soon as all of them\nare finished. Additionally …\n"],["BigBench::Runner::NoBenchmarksDefined","","BigBench/Runner/NoBenchmarksDefined.html","","<p>Is thrown when no benchmarks are defined\n"],["BigBench::Store","","BigBench/Store.html","","<p>The store encapsulates the communication with the redis key-value store. To\nthe outside it looks like …\n"],["BigBench::Tracker","","BigBench/Tracker.html","","<p>The tracker records all request results a benchmark makes. When the\nbenchmark is finished, the trackings …\n"],["BigBench::Tracker::Tracker","","BigBench/Tracker/Tracker.html","",""],["EventMachineLoop","","EventMachineLoop.html","",""],["Float","","Float.html","","<p>Adds the <code>to_milliseconds</code> method to any float value\n"],["Helpers","","Helpers.html","",""],["Object","","Object.html","",""],["add","BigBench::Benchmark","BigBench/Benchmark.html#method-c-add","(options, &block)","<p>Adds a benchmark to the <code>BigBench</code> module. It can later be\nretrieved with the <code>all</code> method.\n"],["add_option","BigBench::Configuration::Config","BigBench/Configuration/Config.html#method-c-add_option","(name)",""],["add_tracking","BigBench::Store","BigBench/Store.html#method-c-add_tracking","(tracking)","<p>Add a tracking to the trackings\n"],["all","BigBench::Benchmark","BigBench/Benchmark.html#method-c-all","()","<p>Returns all benchmarks that are registered\n"],["all_requests_done?","EventMachineLoop","EventMachineLoop.html#method-i-all_requests_done-3F","()",""],["authorized?","Object","Object.html#method-i-authorized-3F","()",""],["benchmark","BigBench","BigBench.html#method-c-benchmark","(options)","<p>Add a benchmark like this:\n\n<pre class=\"ruby\"><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>\n <span class=\"ruby-identifier\">get</span> <span class=\"ruby-string\">"/"</span> <span class=\"ruby-operator\">...</span>\n</pre>\n"],["benchmarks","BigBench","BigBench.html#method-c-benchmarks","()","<p>List all available benchmarks\n"],["bot_is_checking","BigBench::Output","BigBench/Output.html#method-c-bot_is_checking","()",""],["bot_is_working","BigBench::Store","BigBench/Store.html#method-c-bot_is_working","(id)","<p>Adds a bot to the currently working bots list\n"],["bot_received_test_instructions","BigBench::Output","BigBench/Output.html#method-c-bot_received_test_instructions","()",""],["bot_stopped_working","BigBench::Store","BigBench/Store.html#method-c-bot_stopped_working","(id)","<p>Removes a bot to the currently working bots list\n"],["bots","BigBench::Store","BigBench/Store.html#method-c-bots","()","<p>Shows all currently working bots\n"],["check_config!","BigBench","BigBench.html#method-c-check_config-21","()","<p>Checks if all necessary config options are set and raises an\n<code>InvalidOptions</code> exception if not\n"],["check_test!","BigBench::Bot","BigBench/Bot.html#method-c-check_test-21","()","<p>Checks if there is a new test waiting on the store.\n<p>If yes, it loads this test and executes it. After …\n"],["config","BigBench","BigBench.html#method-c-config","()","<p>Set and retreive the config values like this:\n\n<pre class=\"ruby\"><span class=\"ruby-constant\">BigBench</span>.<span class=\"ruby-identifier\">config</span>.<span class=\"ruby-identifier\">duration</span> <span class=\"ruby-comment\"># => 10.seconds</span>\n<span class=\"ruby-constant\">BigBench</span>.<span class=\"ruby-identifier\">config</span>.<span class=\"ruby-identifier\">duration</span> <span class=\"ruby-operator\">...</span>\n</pre>\n"],["config","BigBench::Configuration","BigBench/Configuration.html#method-c-config","()","<p>Returns the current config object\n"],["configure=","BigBench","BigBench.html#method-c-configure-3D","(config)","<p>Configure the benchmark by supplying a hash of options like this:\n\n<pre>BigBench.configure = {\n :duration ...</pre>\n"],["configure=","BigBench::Configuration","BigBench/Configuration.html#method-c-configure-3D","(config)","<p>Configures the benchmarks with a hash. If the config methods are not\npresent yet, they are added to the …\n"],["count_trackings","BigBench::Store","BigBench/Store.html#method-c-count_trackings","()","<p>How many trackings are in the list\n"],["delete","BigBench::Fragment","BigBench/Fragment.html#method-c-delete","(path, options = {})","<p>Performs a DELETE request to the given url, e.g.\n\n<pre>delete "/books/5"</pre>\n"],["deployed_test","BigBench::Output","BigBench/Output.html#method-c-deployed_test","()",""],["done","BigBench::Output","BigBench/Output.html#method-c-done","()",""],["duration","BigBench","BigBench.html#method-c-duration","()","<p>Returns the duration of all benchmarks - ergo the duration of the longest\none\n"],["finished_bots_loop","BigBench::Output","BigBench/Output.html#method-c-finished_bots_loop","()",""],["finished_running_benchmarks","BigBench::Output","BigBench/Output.html#method-c-finished_running_benchmarks","()",""],["finished_writing_trackings","BigBench::Output","BigBench/Output.html#method-c-finished_writing_trackings","(count)",""],["get","BigBench::Fragment","BigBench/Fragment.html#method-c-get","(path, options = {})","<p>Performs a GET request to the given url, e.g.\n\n<pre>get "/some/page"</pre>\n"],["is_running?","BigBench::Benchmark::Benchmark","BigBench/Benchmark/Benchmark.html#method-i-is_running-3F","()","<p>Returns if this benchmark is currently running\n"],["load_test!","BigBench","BigBench.html#method-c-load_test-21","(test)","<p>Loads a test from a string file that is either parsed from a local file or\nretreived from the key-value …\n"],["loaded_tests","BigBench::Output","BigBench/Output.html#method-c-loaded_tests","()",""],["loop!","BigBench::Benchmark::Looper","BigBench/Benchmark/Looper.html#method-i-loop-21","()",""],["max_duration","BigBench::Benchmark","BigBench/Benchmark.html#method-c-max_duration","()","<p>Returns the longest duration of all benchmarks\n"],["message","BigBench::Configuration::InvalidOptions","BigBench/Configuration/InvalidOptions.html#method-i-message","()",""],["message","BigBench::Executor::InvalidCommand","BigBench/Executor/InvalidCommand.html#method-i-message","()",""],["message","BigBench::Runner::NoBenchmarksDefined","BigBench/Runner/NoBenchmarksDefined.html#method-i-message","()",""],["new","BigBench::Benchmark::Benchmark","BigBench/Benchmark/Benchmark.html#method-c-new","(name, url, options, &block)","<p>Initizalizes a new benchmark\n"],["new","BigBench::Benchmark::Looper","BigBench/Benchmark/Looper.html#method-c-new","(benchmark)",""],["new","BigBench::Configuration::Config","BigBench/Configuration/Config.html#method-c-new","()",""],["new","BigBench::Fragment::Fragment","BigBench/Fragment/Fragment.html#method-c-new","(benchmark, path, method, options = {})",""],["new","BigBench::Tracker::Tracker","BigBench/Tracker/Tracker.html#method-c-new","()",""],["new","EventMachineLoop","EventMachineLoop.html#method-c-new","(loops)",""],["next_fragment","BigBench::Benchmark::Looper","BigBench/Benchmark/Looper.html#method-i-next_fragment","()",""],["parse","BigBench::Fragment","BigBench/Fragment.html#method-c-parse","(benchmark, &block)","<p>Evaluates a benchmark block full of puts and gets and returns an array of\nfully configured fragments …\n"],["pop_tracking","BigBench::Store","BigBench/Store.html#method-c-pop_tracking","()","<p>Pop a tracking from the beginning of the list\n"],["post","BigBench::Fragment","BigBench/Fragment.html#method-c-post","(path, options = {})","<p>Performs a POST request to the given url, e.g.\n\n<pre>post "/login"</pre>\n"],["protected!","Object","Object.html#method-i-protected-21","()",""],["put","BigBench::Fragment","BigBench/Fragment.html#method-c-put","(path, options = {})","<p>Performs a PUT request to the given url, e.g.\n\n<pre>put "/books"</pre>\n"],["request!","EventMachineLoop","EventMachineLoop.html#method-i-request-21","()",""],["reset","BigBench::Output","BigBench/Output.html#method-c-reset","()",""],["reset!","BigBench::Benchmark","BigBench/Benchmark.html#method-c-reset-21","()","<p>Resets all benchmarks\n"],["reset!","BigBench::Configuration","BigBench/Configuration.html#method-c-reset-21","()","<p>Resets the config object\n"],["reset!","BigBench::Fragment","BigBench/Fragment.html#method-c-reset-21","()","<p>Reset all fragments\n"],["reset!","BigBench::Store","BigBench/Store.html#method-c-reset-21","()","<p>Deletes all BigBench related keys on the redis store\n"],["run!","BigBench","BigBench.html#method-c-run-21","()","<p>Runs all initialized benchmarks\n"],["run!","BigBench::Benchmark::Benchmark","BigBench/Benchmark/Benchmark.html#method-i-run-21","()","<p>Execute this benchmark\n"],["run!","BigBench::Executor","BigBench/Executor.html#method-c-run-21","(argv)","<p>Parses and runs the BigBench funtion that is supplied via the commandline’s\nARGV. It throws an <code>InvalidCommand</code> …\n"],["run!","BigBench::Fragment::Fragment","BigBench/Fragment/Fragment.html#method-i-run-21","()","<p>Initiates the request in the context of a <code>Net::HTTP.start</code>\nblock\n"],["run!","BigBench::Runner","BigBench/Runner.html#method-c-run-21","()","<p>Runs all benchmarks\n"],["running?","BigBench::Store","BigBench/Store.html#method-c-running-3F","()","<p>Returns true if a bot test has been started\n"],["running_benchmarks","BigBench::Output","BigBench/Output.html#method-c-running_benchmarks","()",""],["running_bots_loop","BigBench::Output","BigBench/Output.html#method-c-running_bots_loop","(bots)",""],["setup!","BigBench::Store","BigBench/Store.html#method-c-setup-21","(url = \"localhost:6379\", password = nil)","<p>Setup the redis storage. Default values are <code>localhost:6379</code> and\nno password. This needs to be called for …\n"],["start","BigBench::Output","BigBench/Output.html#method-c-start","()",""],["start","BigBench::Store","BigBench/Store.html#method-c-start","()","<p>Start the tests for all bots by setting the running key\n"],["starting_bots_loop","BigBench::Output","BigBench/Output.html#method-c-starting_bots_loop","()",""],["stop","BigBench::Store","BigBench/Store.html#method-c-stop","()","<p>Stops the test for all bots by unsetting the running key\n"],["test","BigBench::Store","BigBench/Store.html#method-c-test","()","<p>Gets the current test from the redis\n"],["test=","BigBench::Store","BigBench/Store.html#method-c-test-3D","(test)","<p>Stores the current test receipt for all bots on the redis instance\n"],["to_milliseconds","Float","Float.html#method-i-to_milliseconds","()",""],["track","BigBench::Tracker::Tracker","BigBench/Tracker/Tracker.html#method-i-track","(object)",""],["track!","BigBench::Fragment::Fragment","BigBench/Fragment/Fragment.html#method-i-track-21","(start, stop, http)","<p>Adds the current tracking result as a hash to the benchmark’s tracker\n"],["valid?","BigBench::Configuration::Config","BigBench/Configuration/Config.html#method-i-valid-3F","()",""],["write_local_trackings_to_file!","BigBench","BigBench.html#method-c-write_local_trackings_to_file-21","()","<p>Writes the locals trackings from the benchmark to a file\n"],["write_store_trackings_to_file!","BigBench","BigBench.html#method-c-write_store_trackings_to_file-21","()","<p>Gathers the trackings from the redis and writes them to a local file\n"],["write_trackings_to_store!","BigBench","BigBench.html#method-c-write_trackings_to_store-21","()","<p>Writes the trackings of a bot to the redis after he finishes the run\n"],["writing_trackings","BigBench::Output","BigBench/Output.html#method-c-writing_trackings","(count)",""],["wrote_trackings","BigBench::Output","BigBench/Output.html#method-c-wrote_trackings","(count)",""],["Gemfile","","Gemfile.html","","<p>source “rubygems.org”\n<p># Specify your gem’s dependencies in big_bench.gemspec gemspec\n"],["Rakefile","","Rakefile.html","","<p>require “bundler/gem_tasks” require “rack”\n<p>namespace :bigbench do\n\n<pre>desc "Create and ...</pre>\n"],["executor","","lib/bigbench/help/executor_txt.html","","<p>Usage:\n\n<pre># Local Testing\nbigbench run local PATH_TO_TEST # Runs a ...</pre>\n"]]}}
|
1
|
+
var search_data = {"index":{"searchIndex":["bigbench","benchmark","benchmark","looper","bot","configuration","config","invalidoptions","executor","invalidcommand","fragment","fragment","output","postprocessor","environment","invalidprocessor","processor","statistics","test","runner","nobenchmarksdefined","store","tracker","tracker","eventmachineloop","float","helpers","object","add()","add()","add_option()","add_tracking()","all()","all()","all_requests_done?()","authorized?()","benchmark()","benchmarks()","bot_is_checking()","bot_is_working()","bot_received_test_instructions()","bot_stopped_working()","bots()","check_config!()","check_test!()","config()","config()","configure=()","configure=()","count_trackings()","delete()","deployed_test()","done()","duration()","each_tracking()","finished_bots_loop()","finished_running_benchmarks()","finished_writing_trackings()","get()","is_running?()","load_test!()","loaded_tests()","loop!()","max_duration()","message()","message()","message()","message()","new()","new()","new()","new()","new()","new()","new()","next_fragment()","parse()","pop_tracking()","post()","post_process()","post_processors()","protected!()","put()","request!()","reset()","reset!()","reset!()","reset!()","reset!()","reset!()","run!()","run!()","run!()","run!()","run!()","run!()","run!()","run!()","run!()","run_post_processors!()","running?()","running_benchmarks()","running_bots_loop()","setup!()","start()","start()","starting_bots_loop()","stop()","test()","test=()","to_milliseconds()","track()","track!()","valid?()","write_local_trackings_to_file!()","write_store_trackings_to_file!()","write_trackings_to_store!()","writing_trackings()","wrote_trackings()","gemfile","rakefile","executor"],"longSearchIndex":["bigbench","bigbench::benchmark","bigbench::benchmark::benchmark","bigbench::benchmark::looper","bigbench::bot","bigbench::configuration","bigbench::configuration::config","bigbench::configuration::invalidoptions","bigbench::executor","bigbench::executor::invalidcommand","bigbench::fragment","bigbench::fragment::fragment","bigbench::output","bigbench::postprocessor","bigbench::postprocessor::environment","bigbench::postprocessor::invalidprocessor","bigbench::postprocessor::processor","bigbench::postprocessor::statistics","bigbench::postprocessor::test","bigbench::runner","bigbench::runner::nobenchmarksdefined","bigbench::store","bigbench::tracker","bigbench::tracker::tracker","eventmachineloop","float","helpers","object","bigbench::benchmark::add()","bigbench::postprocessor::add()","bigbench::configuration::config::add_option()","bigbench::store::add_tracking()","bigbench::benchmark::all()","bigbench::postprocessor::all()","eventmachineloop#all_requests_done?()","object#authorized?()","bigbench::benchmark()","bigbench::benchmarks()","bigbench::output::bot_is_checking()","bigbench::store::bot_is_working()","bigbench::output::bot_received_test_instructions()","bigbench::store::bot_stopped_working()","bigbench::store::bots()","bigbench::check_config!()","bigbench::bot::check_test!()","bigbench::config()","bigbench::configuration::config()","bigbench::configure=()","bigbench::configuration::configure=()","bigbench::store::count_trackings()","bigbench::fragment::delete()","bigbench::output::deployed_test()","bigbench::output::done()","bigbench::duration()","bigbench::postprocessor::environment#each_tracking()","bigbench::output::finished_bots_loop()","bigbench::output::finished_running_benchmarks()","bigbench::output::finished_writing_trackings()","bigbench::fragment::get()","bigbench::benchmark::benchmark#is_running?()","bigbench::load_test!()","bigbench::output::loaded_tests()","bigbench::benchmark::looper#loop!()","bigbench::benchmark::max_duration()","bigbench::configuration::invalidoptions#message()","bigbench::executor::invalidcommand#message()","bigbench::postprocessor::invalidprocessor#message()","bigbench::runner::nobenchmarksdefined#message()","bigbench::benchmark::benchmark::new()","bigbench::benchmark::looper::new()","bigbench::configuration::config::new()","bigbench::fragment::fragment::new()","bigbench::postprocessor::processor::new()","bigbench::tracker::tracker::new()","eventmachineloop::new()","bigbench::benchmark::looper#next_fragment()","bigbench::fragment::parse()","bigbench::store::pop_tracking()","bigbench::fragment::post()","bigbench::post_process()","bigbench::post_processors()","object#protected!()","bigbench::fragment::put()","eventmachineloop#request!()","bigbench::output::reset()","bigbench::benchmark::reset!()","bigbench::configuration::reset!()","bigbench::fragment::reset!()","bigbench::postprocessor::reset!()","bigbench::store::reset!()","bigbench::run!()","bigbench::benchmark::benchmark#run!()","bigbench::executor::run!()","bigbench::fragment::fragment#run!()","bigbench::postprocessor::run!()","bigbench::postprocessor::processor#run!()","bigbench::postprocessor::statistics::run!()","bigbench::postprocessor::test::run!()","bigbench::runner::run!()","bigbench::run_post_processors!()","bigbench::store::running?()","bigbench::output::running_benchmarks()","bigbench::output::running_bots_loop()","bigbench::store::setup!()","bigbench::output::start()","bigbench::store::start()","bigbench::output::starting_bots_loop()","bigbench::store::stop()","bigbench::store::test()","bigbench::store::test=()","float#to_milliseconds()","bigbench::tracker::tracker#track()","bigbench::fragment::fragment#track!()","bigbench::configuration::config#valid?()","bigbench::write_local_trackings_to_file!()","bigbench::write_store_trackings_to_file!()","bigbench::write_trackings_to_store!()","bigbench::output::writing_trackings()","bigbench::output::wrote_trackings()","","",""],"info":[["BigBench","","BigBench.html","",""],["BigBench::Benchmark","","BigBench/Benchmark.html","","<p>Holds the actual benchmark methods. A benchmark is a sequence of requests\nto the same server, but to …\n"],["BigBench::Benchmark::Benchmark","","BigBench/Benchmark/Benchmark.html","",""],["BigBench::Benchmark::Looper","","BigBench/Benchmark/Looper.html","",""],["BigBench::Bot","","BigBench/Bot.html","","<p>A bot is used for remote testing. It is running in the background of a\nmachine and waits for tests to …\n"],["BigBench::Configuration","","BigBench/Configuration.html","","<p>The configuration is configured in the test reciepts and looks like this:\n\n<pre>BigBench.configure = {\n :duration ...</pre>\n"],["BigBench::Configuration::Config","","BigBench/Configuration/Config.html","","<p>The main config object for BigBench. It allows config options to be added\nand forces some default values …\n"],["BigBench::Configuration::InvalidOptions","","BigBench/Configuration/InvalidOptions.html","","<p>Is returned if the configuration is not filled sufficiently\n"],["BigBench::Executor","","BigBench/Executor.html","","<p>Dispatches the command line commands to BigBench calls. Available commands\nare:\n<p>Usage:\n\n<pre># Local Testing ...</pre>\n"],["BigBench::Executor::InvalidCommand","","BigBench/Executor/InvalidCommand.html","","<p>Is thrown when the command is not known\n"],["BigBench::Fragment","","BigBench/Fragment.html","","<p>A fragment represents a single http request inside a benchmark. It is\nexecuted by the benchmark and resides …\n"],["BigBench::Fragment::Fragment","","BigBench/Fragment/Fragment.html","",""],["BigBench::Output","","BigBench/Output.html","","<p>This module is used to keep all the command line outputs in a single place.\nThe output module gets notified …\n"],["BigBench::PostProcessor","","BigBench/PostProcessor.html","","<p>Post processors are run after all test are finished and the results are\nwritten to the output file. …\n"],["BigBench::PostProcessor::Environment","","BigBench/PostProcessor/Environment.html","","<p>The environment in which the post processors are evaluated. Every method\ndefined here is available in …\n"],["BigBench::PostProcessor::InvalidProcessor","","BigBench/PostProcessor/InvalidProcessor.html","","<p>Thrown if a processor wasn’t initialized the right way\n"],["BigBench::PostProcessor::Processor","","BigBench/PostProcessor/Processor.html","","<p>A single processor, be it a block or a module is always mapped into this\nclass\n"],["BigBench::PostProcessor::Statistics","","BigBench/PostProcessor/Statistics.html","",""],["BigBench::PostProcessor::Test","","BigBench/PostProcessor/Test.html","",""],["BigBench::Runner","","BigBench/Runner.html","","<p>The runner runs all available benchmarks and returns as soon as all of them\nare finished. Additionally …\n"],["BigBench::Runner::NoBenchmarksDefined","","BigBench/Runner/NoBenchmarksDefined.html","","<p>Is thrown when no benchmarks are defined\n"],["BigBench::Store","","BigBench/Store.html","","<p>The store encapsulates the communication with the redis key-value store. To\nthe outside it looks like …\n"],["BigBench::Tracker","","BigBench/Tracker.html","","<p>The tracker records all request results a benchmark makes. When the\nbenchmark is finished, the trackings …\n"],["BigBench::Tracker::Tracker","","BigBench/Tracker/Tracker.html","",""],["EventMachineLoop","","EventMachineLoop.html","",""],["Float","","Float.html","","<p>Adds the <code>to_milliseconds</code> method to any float value\n"],["Helpers","","Helpers.html","",""],["Object","","Object.html","",""],["add","BigBench::Benchmark","BigBench/Benchmark.html#method-c-add","(options, &block)","<p>Adds a benchmark to the <code>BigBench</code> module. It can later be\nretrieved with the <code>all</code> method.\n"],["add","BigBench::PostProcessor","BigBench/PostProcessor.html#method-c-add","(processor = nil, &block)","<p>Adds a new processor\n"],["add_option","BigBench::Configuration::Config","BigBench/Configuration/Config.html#method-c-add_option","(name)",""],["add_tracking","BigBench::Store","BigBench/Store.html#method-c-add_tracking","(tracking)","<p>Add a tracking to the trackings\n"],["all","BigBench::Benchmark","BigBench/Benchmark.html#method-c-all","()","<p>Returns all benchmarks that are registered\n"],["all","BigBench::PostProcessor","BigBench/PostProcessor.html#method-c-all","()","<p>Returns all initialized processors\n"],["all_requests_done?","EventMachineLoop","EventMachineLoop.html#method-i-all_requests_done-3F","()",""],["authorized?","Object","Object.html#method-i-authorized-3F","()",""],["benchmark","BigBench","BigBench.html#method-c-benchmark","(options)","<p>Add a benchmark like this:\n\n<pre class=\"ruby\"><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>\n <span class=\"ruby-identifier\">get</span> <span class=\"ruby-string\">"/"</span> <span class=\"ruby-operator\">...</span>\n</pre>\n"],["benchmarks","BigBench","BigBench.html#method-c-benchmarks","()","<p>List all available benchmarks\n"],["bot_is_checking","BigBench::Output","BigBench/Output.html#method-c-bot_is_checking","()",""],["bot_is_working","BigBench::Store","BigBench/Store.html#method-c-bot_is_working","(id)","<p>Adds a bot to the currently working bots list\n"],["bot_received_test_instructions","BigBench::Output","BigBench/Output.html#method-c-bot_received_test_instructions","()",""],["bot_stopped_working","BigBench::Store","BigBench/Store.html#method-c-bot_stopped_working","(id)","<p>Removes a bot to the currently working bots list\n"],["bots","BigBench::Store","BigBench/Store.html#method-c-bots","()","<p>Shows all currently working bots\n"],["check_config!","BigBench","BigBench.html#method-c-check_config-21","()","<p>Checks if all necessary config options are set and raises an\n<code>InvalidOptions</code> exception if not\n"],["check_test!","BigBench::Bot","BigBench/Bot.html#method-c-check_test-21","()","<p>Checks if there is a new test waiting on the store.\n<p>If yes, it loads this test and executes it. After …\n"],["config","BigBench","BigBench.html#method-c-config","()","<p>Set and retreive the config values like this:\n\n<pre class=\"ruby\"><span class=\"ruby-constant\">BigBench</span>.<span class=\"ruby-identifier\">config</span>.<span class=\"ruby-identifier\">duration</span> <span class=\"ruby-comment\"># => 10.seconds</span>\n<span class=\"ruby-constant\">BigBench</span>.<span class=\"ruby-identifier\">config</span>.<span class=\"ruby-identifier\">duration</span> <span class=\"ruby-operator\">...</span>\n</pre>\n"],["config","BigBench::Configuration","BigBench/Configuration.html#method-c-config","()","<p>Returns the current config object\n"],["configure=","BigBench","BigBench.html#method-c-configure-3D","(config)","<p>Configure the benchmark by supplying a hash of options like this:\n\n<pre>BigBench.configure = {\n :duration ...</pre>\n"],["configure=","BigBench::Configuration","BigBench/Configuration.html#method-c-configure-3D","(config)","<p>Configures the benchmarks with a hash. If the config methods are not\npresent yet, they are added to the …\n"],["count_trackings","BigBench::Store","BigBench/Store.html#method-c-count_trackings","()","<p>How many trackings are in the list\n"],["delete","BigBench::Fragment","BigBench/Fragment.html#method-c-delete","(path, options = {})","<p>Performs a DELETE request to the given url, e.g.\n\n<pre>delete "/books/5"</pre>\n"],["deployed_test","BigBench::Output","BigBench/Output.html#method-c-deployed_test","()",""],["done","BigBench::Output","BigBench/Output.html#method-c-done","()",""],["duration","BigBench","BigBench.html#method-c-duration","()","<p>Returns the duration of all benchmarks - ergo the duration of the longest\none\n"],["each_tracking","BigBench::PostProcessor::Environment","BigBench/PostProcessor/Environment.html#method-i-each_tracking","()","<p>Iterates through every tracking and returns a tracking hash of the\nfollowing form:\n\n<pre class=\"ruby\">{\n :<span class=\"ruby-identifier\">elapsed</span> =<span class=\"ruby-operator\">></span> <span class=\"ruby-operator\">...</span>\n</pre>\n"],["finished_bots_loop","BigBench::Output","BigBench/Output.html#method-c-finished_bots_loop","()",""],["finished_running_benchmarks","BigBench::Output","BigBench/Output.html#method-c-finished_running_benchmarks","()",""],["finished_writing_trackings","BigBench::Output","BigBench/Output.html#method-c-finished_writing_trackings","(count)",""],["get","BigBench::Fragment","BigBench/Fragment.html#method-c-get","(path, options = {})","<p>Performs a GET request to the given url, e.g.\n\n<pre>get "/some/page"</pre>\n"],["is_running?","BigBench::Benchmark::Benchmark","BigBench/Benchmark/Benchmark.html#method-i-is_running-3F","()","<p>Returns if this benchmark is currently running\n"],["load_test!","BigBench","BigBench.html#method-c-load_test-21","(test)","<p>Loads a test from a string file that is either parsed from a local file or\nretreived from the key-value …\n"],["loaded_tests","BigBench::Output","BigBench/Output.html#method-c-loaded_tests","()",""],["loop!","BigBench::Benchmark::Looper","BigBench/Benchmark/Looper.html#method-i-loop-21","()",""],["max_duration","BigBench::Benchmark","BigBench/Benchmark.html#method-c-max_duration","()","<p>Returns the longest duration of all benchmarks\n"],["message","BigBench::Configuration::InvalidOptions","BigBench/Configuration/InvalidOptions.html#method-i-message","()",""],["message","BigBench::Executor::InvalidCommand","BigBench/Executor/InvalidCommand.html#method-i-message","()",""],["message","BigBench::PostProcessor::InvalidProcessor","BigBench/PostProcessor/InvalidProcessor.html#method-i-message","()",""],["message","BigBench::Runner::NoBenchmarksDefined","BigBench/Runner/NoBenchmarksDefined.html#method-i-message","()",""],["new","BigBench::Benchmark::Benchmark","BigBench/Benchmark/Benchmark.html#method-c-new","(name, url, options, &block)","<p>Initizalizes a new benchmark\n"],["new","BigBench::Benchmark::Looper","BigBench/Benchmark/Looper.html#method-c-new","(benchmark)",""],["new","BigBench::Configuration::Config","BigBench/Configuration/Config.html#method-c-new","()",""],["new","BigBench::Fragment::Fragment","BigBench/Fragment/Fragment.html#method-c-new","(benchmark, path, method, options = {})",""],["new","BigBench::PostProcessor::Processor","BigBench/PostProcessor/Processor.html#method-c-new","(processor = nil, &block)","<p>Creates the processor with the block or a processor\n"],["new","BigBench::Tracker::Tracker","BigBench/Tracker/Tracker.html#method-c-new","()",""],["new","EventMachineLoop","EventMachineLoop.html#method-c-new","(loops)",""],["next_fragment","BigBench::Benchmark::Looper","BigBench/Benchmark/Looper.html#method-i-next_fragment","()",""],["parse","BigBench::Fragment","BigBench/Fragment.html#method-c-parse","(benchmark, &block)","<p>Evaluates a benchmark block full of puts and gets and returns an array of\nfully configured fragments …\n"],["pop_tracking","BigBench::Store","BigBench/Store.html#method-c-pop_tracking","()","<p>Pop a tracking from the beginning of the list\n"],["post","BigBench::Fragment","BigBench/Fragment.html#method-c-post","(path, options = {})","<p>Performs a POST request to the given url, e.g.\n\n<pre>post "/login"</pre>\n"],["post_process","BigBench","BigBench.html#method-c-post_process","(processor = nil)","<p>To setup a post processor simply do this:\n\n<pre>post_process do\n # Some code that is executed after the tests, ...</pre>\n"],["post_processors","BigBench","BigBench.html#method-c-post_processors","()","<p>List all initialized post processors\n"],["protected!","Object","Object.html#method-i-protected-21","()",""],["put","BigBench::Fragment","BigBench/Fragment.html#method-c-put","(path, options = {})","<p>Performs a PUT request to the given url, e.g.\n\n<pre>put "/books"</pre>\n"],["request!","EventMachineLoop","EventMachineLoop.html#method-i-request-21","()",""],["reset","BigBench::Output","BigBench/Output.html#method-c-reset","()",""],["reset!","BigBench::Benchmark","BigBench/Benchmark.html#method-c-reset-21","()","<p>Resets all benchmarks\n"],["reset!","BigBench::Configuration","BigBench/Configuration.html#method-c-reset-21","()","<p>Resets the config object\n"],["reset!","BigBench::Fragment","BigBench/Fragment.html#method-c-reset-21","()","<p>Reset all fragments\n"],["reset!","BigBench::PostProcessor","BigBench/PostProcessor.html#method-c-reset-21","()","<p>Resets all post processors\n"],["reset!","BigBench::Store","BigBench/Store.html#method-c-reset-21","()","<p>Deletes all BigBench related keys on the redis store\n"],["run!","BigBench","BigBench.html#method-c-run-21","()","<p>Runs all initialized benchmarks\n"],["run!","BigBench::Benchmark::Benchmark","BigBench/Benchmark/Benchmark.html#method-i-run-21","()","<p>Execute this benchmark\n"],["run!","BigBench::Executor","BigBench/Executor.html#method-c-run-21","(argv)","<p>Parses and runs the BigBench funtion that is supplied via the commandline’s\nARGV. It throws an <code>InvalidCommand</code> …\n"],["run!","BigBench::Fragment::Fragment","BigBench/Fragment/Fragment.html#method-i-run-21","()","<p>Initiates the request in the context of a <code>Net::HTTP.start</code>\nblock\n"],["run!","BigBench::PostProcessor","BigBench/PostProcessor.html#method-c-run-21","()","<p>Runs all post processors in the order they were defined\n"],["run!","BigBench::PostProcessor::Processor","BigBench/PostProcessor/Processor.html#method-i-run-21","()","<p>Run the block of code or the run! method of the processor\n"],["run!","BigBench::PostProcessor::Statistics","BigBench/PostProcessor/Statistics.html#method-c-run-21","()",""],["run!","BigBench::PostProcessor::Test","BigBench/PostProcessor/Test.html#method-c-run-21","()",""],["run!","BigBench::Runner","BigBench/Runner.html#method-c-run-21","()","<p>Runs all benchmarks\n"],["run_post_processors!","BigBench","BigBench.html#method-c-run_post_processors-21","()","<p>Runs all initialized post processors after the trackings have been written\n"],["running?","BigBench::Store","BigBench/Store.html#method-c-running-3F","()","<p>Returns true if a bot test has been started\n"],["running_benchmarks","BigBench::Output","BigBench/Output.html#method-c-running_benchmarks","()",""],["running_bots_loop","BigBench::Output","BigBench/Output.html#method-c-running_bots_loop","(bots)",""],["setup!","BigBench::Store","BigBench/Store.html#method-c-setup-21","(url = \"localhost:6379\", password = nil)","<p>Setup the redis storage. Default values are <code>localhost:6379</code> and\nno password. This needs to be called for …\n"],["start","BigBench::Output","BigBench/Output.html#method-c-start","()",""],["start","BigBench::Store","BigBench/Store.html#method-c-start","()","<p>Start the tests for all bots by setting the running key\n"],["starting_bots_loop","BigBench::Output","BigBench/Output.html#method-c-starting_bots_loop","()",""],["stop","BigBench::Store","BigBench/Store.html#method-c-stop","()","<p>Stops the test for all bots by unsetting the running key\n"],["test","BigBench::Store","BigBench/Store.html#method-c-test","()","<p>Gets the current test from the redis\n"],["test=","BigBench::Store","BigBench/Store.html#method-c-test-3D","(test)","<p>Stores the current test receipt for all bots on the redis instance\n"],["to_milliseconds","Float","Float.html#method-i-to_milliseconds","()",""],["track","BigBench::Tracker::Tracker","BigBench/Tracker/Tracker.html#method-i-track","(object)",""],["track!","BigBench::Fragment::Fragment","BigBench/Fragment/Fragment.html#method-i-track-21","(start, stop, http)","<p>Adds the current tracking result as a hash to the benchmark’s tracker\n"],["valid?","BigBench::Configuration::Config","BigBench/Configuration/Config.html#method-i-valid-3F","()",""],["write_local_trackings_to_file!","BigBench","BigBench.html#method-c-write_local_trackings_to_file-21","()","<p>Writes the locals trackings from the benchmark to a file\n"],["write_store_trackings_to_file!","BigBench","BigBench.html#method-c-write_store_trackings_to_file-21","()","<p>Gathers the trackings from the redis and writes them to a local file\n"],["write_trackings_to_store!","BigBench","BigBench.html#method-c-write_trackings_to_store-21","()","<p>Writes the trackings of a bot to the redis after he finishes the run\n"],["writing_trackings","BigBench::Output","BigBench/Output.html#method-c-writing_trackings","(count)",""],["wrote_trackings","BigBench::Output","BigBench/Output.html#method-c-wrote_trackings","(count)",""],["Gemfile","","Gemfile.html","","<p>source “rubygems.org”\n<p># Specify your gem’s dependencies in big_bench.gemspec gemspec\n"],["Rakefile","","Rakefile.html","","<p>require “bundler/gem_tasks” require “rack”\n<p>namespace :bigbench do\n\n<pre>desc "Create and ...</pre>\n"],["executor","","lib/bigbench/help/executor_txt.html","","<p>Usage:\n\n<pre># Local Testing\nbigbench run local PATH_TO_TEST # Runs a ...</pre>\n"]]}}
|
@@ -89,6 +89,18 @@
|
|
89
89
|
|
90
90
|
<li><a href="../../../BigBench/Output.html">BigBench::Output</a>
|
91
91
|
|
92
|
+
<li><a href="../../../BigBench/PostProcessor.html">BigBench::PostProcessor</a>
|
93
|
+
|
94
|
+
<li><a href="../../../BigBench/PostProcessor/Environment.html">BigBench::PostProcessor::Environment</a>
|
95
|
+
|
96
|
+
<li><a href="../../../BigBench/PostProcessor/InvalidProcessor.html">BigBench::PostProcessor::InvalidProcessor</a>
|
97
|
+
|
98
|
+
<li><a href="../../../BigBench/PostProcessor/Processor.html">BigBench::PostProcessor::Processor</a>
|
99
|
+
|
100
|
+
<li><a href="../../../BigBench/PostProcessor/Statistics.html">BigBench::PostProcessor::Statistics</a>
|
101
|
+
|
102
|
+
<li><a href="../../../BigBench/PostProcessor/Test.html">BigBench::PostProcessor::Test</a>
|
103
|
+
|
92
104
|
<li><a href="../../../BigBench/Runner.html">BigBench::Runner</a>
|
93
105
|
|
94
106
|
<li><a href="../../../BigBench/Runner/NoBenchmarksDefined.html">BigBench::Runner::NoBenchmarksDefined</a>
|
data/doc/table_of_contents.html
CHANGED
@@ -77,6 +77,29 @@
|
|
77
77
|
</li>
|
78
78
|
<li class="module">
|
79
79
|
<a href="BigBench/Output.html">BigBench::Output</a>
|
80
|
+
</li>
|
81
|
+
<li class="module">
|
82
|
+
<a href="BigBench/PostProcessor.html">BigBench::PostProcessor</a>
|
83
|
+
|
84
|
+
<img class="toc-toggle" src="images/transparent.png" alt="" title="toggle headings">
|
85
|
+
<ul class="initially-hidden">
|
86
|
+
<li><a href="BigBench/PostProcessor.html#label-Available+Methods+in+Processors">Available Methods in Processors</a>
|
87
|
+
</ul>
|
88
|
+
</li>
|
89
|
+
<li class="module">
|
90
|
+
<a href="BigBench/PostProcessor/Environment.html">BigBench::PostProcessor::Environment</a>
|
91
|
+
</li>
|
92
|
+
<li class="class">
|
93
|
+
<a href="BigBench/PostProcessor/InvalidProcessor.html">BigBench::PostProcessor::InvalidProcessor</a>
|
94
|
+
</li>
|
95
|
+
<li class="class">
|
96
|
+
<a href="BigBench/PostProcessor/Processor.html">BigBench::PostProcessor::Processor</a>
|
97
|
+
</li>
|
98
|
+
<li class="module">
|
99
|
+
<a href="BigBench/PostProcessor/Statistics.html">BigBench::PostProcessor::Statistics</a>
|
100
|
+
</li>
|
101
|
+
<li class="module">
|
102
|
+
<a href="BigBench/PostProcessor/Test.html">BigBench::PostProcessor::Test</a>
|
80
103
|
</li>
|
81
104
|
<li class="module">
|
82
105
|
<a href="BigBench/Runner.html">BigBench::Runner</a>
|
@@ -113,10 +136,14 @@
|
|
113
136
|
|
114
137
|
<li class="method"><a href="BigBench/Benchmark.html#method-c-add">::add — BigBench::Benchmark</a>
|
115
138
|
|
139
|
+
<li class="method"><a href="BigBench/PostProcessor.html#method-c-add">::add — BigBench::PostProcessor</a>
|
140
|
+
|
116
141
|
<li class="method"><a href="BigBench/Configuration/Config.html#method-c-add_option">::add_option — BigBench::Configuration::Config</a>
|
117
142
|
|
118
143
|
<li class="method"><a href="BigBench/Store.html#method-c-add_tracking">::add_tracking — BigBench::Store</a>
|
119
144
|
|
145
|
+
<li class="method"><a href="BigBench/PostProcessor.html#method-c-all">::all — BigBench::PostProcessor</a>
|
146
|
+
|
120
147
|
<li class="method"><a href="BigBench/Benchmark.html#method-c-all">::all — BigBench::Benchmark</a>
|
121
148
|
|
122
149
|
<li class="method"><a href="BigBench.html#method-c-benchmark">::benchmark — BigBench</a>
|
@@ -137,10 +164,10 @@
|
|
137
164
|
|
138
165
|
<li class="method"><a href="BigBench/Bot.html#method-c-check_test-21">::check_test! — BigBench::Bot</a>
|
139
166
|
|
140
|
-
<li class="method"><a href="BigBench.html#method-c-config">::config — BigBench</a>
|
141
|
-
|
142
167
|
<li class="method"><a href="BigBench/Configuration.html#method-c-config">::config — BigBench::Configuration</a>
|
143
168
|
|
169
|
+
<li class="method"><a href="BigBench.html#method-c-config">::config — BigBench</a>
|
170
|
+
|
144
171
|
<li class="method"><a href="BigBench/Configuration.html#method-c-configure-3D">::configure= — BigBench::Configuration</a>
|
145
172
|
|
146
173
|
<li class="method"><a href="BigBench.html#method-c-configure-3D">::configure= — BigBench</a>
|
@@ -169,17 +196,19 @@
|
|
169
196
|
|
170
197
|
<li class="method"><a href="BigBench/Benchmark.html#method-c-max_duration">::max_duration — BigBench::Benchmark</a>
|
171
198
|
|
172
|
-
<li class="method"><a href="
|
199
|
+
<li class="method"><a href="EventMachineLoop.html#method-c-new">::new — EventMachineLoop</a>
|
173
200
|
|
174
|
-
<li class="method"><a href="BigBench/
|
201
|
+
<li class="method"><a href="BigBench/Benchmark/Benchmark.html#method-c-new">::new — BigBench::Benchmark::Benchmark</a>
|
202
|
+
|
203
|
+
<li class="method"><a href="BigBench/Tracker/Tracker.html#method-c-new">::new — BigBench::Tracker::Tracker</a>
|
175
204
|
|
176
205
|
<li class="method"><a href="BigBench/Configuration/Config.html#method-c-new">::new — BigBench::Configuration::Config</a>
|
177
206
|
|
178
|
-
<li class="method"><a href="BigBench/
|
207
|
+
<li class="method"><a href="BigBench/PostProcessor/Processor.html#method-c-new">::new — BigBench::PostProcessor::Processor</a>
|
179
208
|
|
180
|
-
<li class="method"><a href="BigBench/
|
209
|
+
<li class="method"><a href="BigBench/Fragment/Fragment.html#method-c-new">::new — BigBench::Fragment::Fragment</a>
|
181
210
|
|
182
|
-
<li class="method"><a href="
|
211
|
+
<li class="method"><a href="BigBench/Benchmark/Looper.html#method-c-new">::new — BigBench::Benchmark::Looper</a>
|
183
212
|
|
184
213
|
<li class="method"><a href="BigBench/Fragment.html#method-c-parse">::parse — BigBench::Fragment</a>
|
185
214
|
|
@@ -187,24 +216,38 @@
|
|
187
216
|
|
188
217
|
<li class="method"><a href="BigBench/Fragment.html#method-c-post">::post — BigBench::Fragment</a>
|
189
218
|
|
219
|
+
<li class="method"><a href="BigBench.html#method-c-post_process">::post_process — BigBench</a>
|
220
|
+
|
221
|
+
<li class="method"><a href="BigBench.html#method-c-post_processors">::post_processors — BigBench</a>
|
222
|
+
|
190
223
|
<li class="method"><a href="BigBench/Fragment.html#method-c-put">::put — BigBench::Fragment</a>
|
191
224
|
|
192
225
|
<li class="method"><a href="BigBench/Output.html#method-c-reset">::reset — BigBench::Output</a>
|
193
226
|
|
194
227
|
<li class="method"><a href="BigBench/Benchmark.html#method-c-reset-21">::reset! — BigBench::Benchmark</a>
|
195
228
|
|
229
|
+
<li class="method"><a href="BigBench/PostProcessor.html#method-c-reset-21">::reset! — BigBench::PostProcessor</a>
|
230
|
+
|
196
231
|
<li class="method"><a href="BigBench/Configuration.html#method-c-reset-21">::reset! — BigBench::Configuration</a>
|
197
232
|
|
233
|
+
<li class="method"><a href="BigBench/Store.html#method-c-reset-21">::reset! — BigBench::Store</a>
|
234
|
+
|
198
235
|
<li class="method"><a href="BigBench/Fragment.html#method-c-reset-21">::reset! — BigBench::Fragment</a>
|
199
236
|
|
200
|
-
<li class="method"><a href="BigBench
|
237
|
+
<li class="method"><a href="BigBench.html#method-c-run-21">::run! — BigBench</a>
|
201
238
|
|
202
239
|
<li class="method"><a href="BigBench/Runner.html#method-c-run-21">::run! — BigBench::Runner</a>
|
203
240
|
|
204
|
-
<li class="method"><a href="BigBench.html#method-c-run-21">::run! — BigBench</a>
|
241
|
+
<li class="method"><a href="BigBench/PostProcessor/Statistics.html#method-c-run-21">::run! — BigBench::PostProcessor::Statistics</a>
|
242
|
+
|
243
|
+
<li class="method"><a href="BigBench/PostProcessor.html#method-c-run-21">::run! — BigBench::PostProcessor</a>
|
205
244
|
|
206
245
|
<li class="method"><a href="BigBench/Executor.html#method-c-run-21">::run! — BigBench::Executor</a>
|
207
246
|
|
247
|
+
<li class="method"><a href="BigBench/PostProcessor/Test.html#method-c-run-21">::run! — BigBench::PostProcessor::Test</a>
|
248
|
+
|
249
|
+
<li class="method"><a href="BigBench.html#method-c-run_post_processors-21">::run_post_processors! — BigBench</a>
|
250
|
+
|
208
251
|
<li class="method"><a href="BigBench/Store.html#method-c-running-3F">::running? — BigBench::Store</a>
|
209
252
|
|
210
253
|
<li class="method"><a href="BigBench/Output.html#method-c-running_benchmarks">::running_benchmarks — BigBench::Output</a>
|
@@ -213,10 +256,10 @@
|
|
213
256
|
|
214
257
|
<li class="method"><a href="BigBench/Store.html#method-c-setup-21">::setup! — BigBench::Store</a>
|
215
258
|
|
216
|
-
<li class="method"><a href="BigBench/Store.html#method-c-start">::start — BigBench::Store</a>
|
217
|
-
|
218
259
|
<li class="method"><a href="BigBench/Output.html#method-c-start">::start — BigBench::Output</a>
|
219
260
|
|
261
|
+
<li class="method"><a href="BigBench/Store.html#method-c-start">::start — BigBench::Store</a>
|
262
|
+
|
220
263
|
<li class="method"><a href="BigBench/Output.html#method-c-starting_bots_loop">::starting_bots_loop — BigBench::Output</a>
|
221
264
|
|
222
265
|
<li class="method"><a href="BigBench/Store.html#method-c-stop">::stop — BigBench::Store</a>
|
@@ -239,16 +282,20 @@
|
|
239
282
|
|
240
283
|
<li class="method"><a href="Object.html#method-i-authorized-3F">#authorized? — Object</a>
|
241
284
|
|
285
|
+
<li class="method"><a href="BigBench/PostProcessor/Environment.html#method-i-each_tracking">#each_tracking — BigBench::PostProcessor::Environment</a>
|
286
|
+
|
242
287
|
<li class="method"><a href="BigBench/Benchmark/Benchmark.html#method-i-is_running-3F">#is_running? — BigBench::Benchmark::Benchmark</a>
|
243
288
|
|
244
289
|
<li class="method"><a href="BigBench/Benchmark/Looper.html#method-i-loop-21">#loop! — BigBench::Benchmark::Looper</a>
|
245
290
|
|
246
291
|
<li class="method"><a href="BigBench/Runner/NoBenchmarksDefined.html#method-i-message">#message — BigBench::Runner::NoBenchmarksDefined</a>
|
247
292
|
|
248
|
-
<li class="method"><a href="BigBench/Configuration/InvalidOptions.html#method-i-message">#message — BigBench::Configuration::InvalidOptions</a>
|
249
|
-
|
250
293
|
<li class="method"><a href="BigBench/Executor/InvalidCommand.html#method-i-message">#message — BigBench::Executor::InvalidCommand</a>
|
251
294
|
|
295
|
+
<li class="method"><a href="BigBench/PostProcessor/InvalidProcessor.html#method-i-message">#message — BigBench::PostProcessor::InvalidProcessor</a>
|
296
|
+
|
297
|
+
<li class="method"><a href="BigBench/Configuration/InvalidOptions.html#method-i-message">#message — BigBench::Configuration::InvalidOptions</a>
|
298
|
+
|
252
299
|
<li class="method"><a href="BigBench/Benchmark/Looper.html#method-i-next_fragment">#next_fragment — BigBench::Benchmark::Looper</a>
|
253
300
|
|
254
301
|
<li class="method"><a href="Object.html#method-i-protected-21">#protected! — Object</a>
|
@@ -257,6 +304,8 @@
|
|
257
304
|
|
258
305
|
<li class="method"><a href="BigBench/Fragment/Fragment.html#method-i-run-21">#run! — BigBench::Fragment::Fragment</a>
|
259
306
|
|
307
|
+
<li class="method"><a href="BigBench/PostProcessor/Processor.html#method-i-run-21">#run! — BigBench::PostProcessor::Processor</a>
|
308
|
+
|
260
309
|
<li class="method"><a href="BigBench/Benchmark/Benchmark.html#method-i-run-21">#run! — BigBench::Benchmark::Benchmark</a>
|
261
310
|
|
262
311
|
<li class="method"><a href="Float.html#method-i-to_milliseconds">#to_milliseconds — Float</a>
|
data/lib/bigbench.rb
CHANGED
@@ -1,9 +1,10 @@
|
|
1
|
+
require 'rubygems'
|
2
|
+
require 'active_support/all'
|
3
|
+
require 'action_view'
|
1
4
|
require 'redis'
|
2
|
-
require 'net/http'
|
3
5
|
require 'eventmachine'
|
4
6
|
require 'em-http'
|
5
|
-
require '
|
6
|
-
require 'active_support/all'
|
7
|
+
require 'hirb'
|
7
8
|
|
8
9
|
require "bigbench/float_extensions"
|
9
10
|
require "bigbench/version"
|
@@ -17,5 +18,7 @@ require "bigbench/executor"
|
|
17
18
|
require "bigbench/store"
|
18
19
|
require "bigbench/bot"
|
19
20
|
require "bigbench/output"
|
21
|
+
require "bigbench/post_processor"
|
22
|
+
require "bigbench/post_processor/statistics"
|
20
23
|
|
21
24
|
load "bigbench/initializers.rb"
|
data/lib/bigbench/benchmark.rb
CHANGED
data/lib/bigbench/executor.rb
CHANGED
@@ -56,6 +56,7 @@ module BigBench
|
|
56
56
|
BigBench.load_test! File.open(argv[2], "rb"){ |file| file.read }
|
57
57
|
BigBench.run!
|
58
58
|
BigBench.write_local_trackings_to_file!
|
59
|
+
BigBench.run_post_processors!
|
59
60
|
end
|
60
61
|
|
61
62
|
# Runs a test on all available bots with the specified test.rb
|
@@ -97,6 +98,7 @@ module BigBench
|
|
97
98
|
# Gather trackings from redis and write them to the file
|
98
99
|
BigBench::Output.finished_bots_loop
|
99
100
|
BigBench.write_store_trackings_to_file!
|
101
|
+
BigBench.run_post_processors!
|
100
102
|
BigBench::Store.reset!
|
101
103
|
end
|
102
104
|
|
data/lib/bigbench/fragment.rb
CHANGED
@@ -0,0 +1,206 @@
|
|
1
|
+
module BigBench
|
2
|
+
|
3
|
+
# Post processors are run after all test are finished and the results are written to the output file.
|
4
|
+
# A post processor can either be a block of code, or an existing post processor module. To setup a post processor simply do this:
|
5
|
+
#
|
6
|
+
# post_process do
|
7
|
+
# # Some code that is executed after the tests, like a database update, twitter post, email etc.
|
8
|
+
# end
|
9
|
+
#
|
10
|
+
# Or use one of the predefined post processor or write one yourself:
|
11
|
+
#
|
12
|
+
# post_process :statistics
|
13
|
+
# post_process BigBench::PostProcessor::Statistics
|
14
|
+
# post_process "statistics"
|
15
|
+
#
|
16
|
+
# All the upper lines include the same post processor. Symbols and strings are camelized and constantized as the module name.
|
17
|
+
#
|
18
|
+
# == Available Methods in Processors
|
19
|
+
#
|
20
|
+
# Every post processor block or module supports the following methods and has full
|
21
|
+
# {ActionView::Helper}[http://api.rubyonrails.org/classes/ActionView/Helpers.html] support.
|
22
|
+
#
|
23
|
+
# [each_tracking] A method that iterates through every collected tracking. It automatically returns a hash with a single
|
24
|
+
# tracking of the following form:
|
25
|
+
#
|
26
|
+
# {
|
27
|
+
# :elapsed => 2.502132,
|
28
|
+
# :start => 1333986292.1755981,
|
29
|
+
# :stop => 1333986293.618884,
|
30
|
+
# :duration => 1443,
|
31
|
+
# :benchmark => "index page",
|
32
|
+
# :url => "http://www.google.de/",
|
33
|
+
# :path => "/",
|
34
|
+
# :method => "get",
|
35
|
+
# :status => 200
|
36
|
+
# }
|
37
|
+
#
|
38
|
+
# It can be used like this:
|
39
|
+
#
|
40
|
+
# post_process do
|
41
|
+
#
|
42
|
+
# total_trackings, total_errors = 0, 0
|
43
|
+
# each_tracking do |tracking|
|
44
|
+
# total_trackings += 1
|
45
|
+
# total_errors += 1 unless tracking[:status] == 200
|
46
|
+
# end
|
47
|
+
#
|
48
|
+
# Twitter.post "Just run BigBench with #{total_trackings} trackings and #{total_errors} errors."
|
49
|
+
#
|
50
|
+
# end
|
51
|
+
#
|
52
|
+
module PostProcessor
|
53
|
+
|
54
|
+
@processors = []
|
55
|
+
|
56
|
+
# Runs all post processors in the order they were defined
|
57
|
+
def self.run!
|
58
|
+
all.each{ |processor| processor.run! }
|
59
|
+
end
|
60
|
+
|
61
|
+
# A single processor, be it a block or a module is always mapped into this class
|
62
|
+
class Processor
|
63
|
+
attr_accessor :proc
|
64
|
+
|
65
|
+
# Creates the processor with the block or a processor
|
66
|
+
def initialize(processor = nil, &block)
|
67
|
+
@proc = processor_to_proc(processor) || block
|
68
|
+
end
|
69
|
+
|
70
|
+
# Run the block of code or the run! method of the processor
|
71
|
+
def run!
|
72
|
+
PostProcessor::Environment.module_exec(&@proc)
|
73
|
+
end
|
74
|
+
|
75
|
+
private
|
76
|
+
|
77
|
+
def processor_to_proc(processor)
|
78
|
+
return nil if processor.nil?
|
79
|
+
processor = processor_to_module(processor)
|
80
|
+
processor.module_eval do
|
81
|
+
class << self
|
82
|
+
include Environment
|
83
|
+
include ActionView::Helpers
|
84
|
+
end
|
85
|
+
end
|
86
|
+
processor.method(:run!).to_proc
|
87
|
+
end
|
88
|
+
|
89
|
+
def processor_to_module(processor)
|
90
|
+
return processor if processor.is_a? Module
|
91
|
+
"BigBench::PostProcessor::#{processor.to_s.camelize}".constantize
|
92
|
+
end
|
93
|
+
end
|
94
|
+
|
95
|
+
# Adds a new processor
|
96
|
+
def self.add(processor = nil, &block)
|
97
|
+
@processors << Processor.new(processor, &block)
|
98
|
+
end
|
99
|
+
|
100
|
+
# Returns all initialized processors
|
101
|
+
def self.all
|
102
|
+
@processors
|
103
|
+
end
|
104
|
+
|
105
|
+
# Resets all post processors
|
106
|
+
def self.reset!
|
107
|
+
@processors = []
|
108
|
+
end
|
109
|
+
|
110
|
+
# Thrown if a processor wasn't initialized the right way
|
111
|
+
class InvalidProcessor < StandardError
|
112
|
+
def message
|
113
|
+
"You have to either specify a valid post processor or a block"
|
114
|
+
end
|
115
|
+
end
|
116
|
+
|
117
|
+
# The environment in which the post processors are evaluated. Every method defined here is available in
|
118
|
+
# the post_process block and run! methods of the predefined post processors
|
119
|
+
module Environment
|
120
|
+
|
121
|
+
# Iterates through every tracking and returns a tracking hash of the following form:
|
122
|
+
#
|
123
|
+
# {
|
124
|
+
# :elapsed => 2.502132,
|
125
|
+
# :start => 1333986292.1755981,
|
126
|
+
# :stop => 1333986293.618884,
|
127
|
+
# :duration => 1443,
|
128
|
+
# :benchmark => "index page",
|
129
|
+
# :url => "http://www.google.de/",
|
130
|
+
# :path => "/",
|
131
|
+
# :method => "get",
|
132
|
+
# :status => 200
|
133
|
+
# }
|
134
|
+
#
|
135
|
+
def each_tracking
|
136
|
+
File.open(BigBench.config.output, "r+") do |file|
|
137
|
+
file.each_line { |line| yield JSON.parse(line).inject({}){|memo,(k,v)| memo[k.to_sym] = v; memo} unless line.blank? }
|
138
|
+
end
|
139
|
+
end
|
140
|
+
end
|
141
|
+
|
142
|
+
end
|
143
|
+
|
144
|
+
# To setup a post processor simply do this:
|
145
|
+
#
|
146
|
+
# post_process do
|
147
|
+
# # Some code that is executed after the tests, like a database update, twitter post, email etc.
|
148
|
+
# end
|
149
|
+
#
|
150
|
+
# Or use one of the predefined post processor or write one yourself:
|
151
|
+
#
|
152
|
+
# post_process :statistics
|
153
|
+
# post_process BigBench::PostProcessor::Statistics
|
154
|
+
# post_process "statistics"
|
155
|
+
#
|
156
|
+
# All the upper lines include the same post processor. Symbols and strings are camelized and constantized as the module name.
|
157
|
+
#
|
158
|
+
# == Available Methods in Processors
|
159
|
+
#
|
160
|
+
# Every post processor block or module supports the following methods and has full
|
161
|
+
# {ActionView::Helper}[http://api.rubyonrails.org/classes/ActionView/Helpers.html] support.
|
162
|
+
#
|
163
|
+
# [each_tracking] A method that iterates through every collected tracking. It automatically returns a hash with a single
|
164
|
+
# tracking of the following form:
|
165
|
+
#
|
166
|
+
# {
|
167
|
+
# :elapsed => 2.502132,
|
168
|
+
# :start => 1333986292.1755981,
|
169
|
+
# :stop => 1333986293.618884,
|
170
|
+
# :duration => 1443,
|
171
|
+
# :benchmark => "index page",
|
172
|
+
# :url => "http://www.google.de/",
|
173
|
+
# :path => "/",
|
174
|
+
# :method => "get",
|
175
|
+
# :status => 200
|
176
|
+
# }
|
177
|
+
#
|
178
|
+
# It can be used like this:
|
179
|
+
#
|
180
|
+
# post_process do
|
181
|
+
#
|
182
|
+
# total_trackings, total_errors = 0, 0
|
183
|
+
# each_tracking do |tracking|
|
184
|
+
# total_trackings += 1
|
185
|
+
# total_errors += 1 unless tracking[:status] == 200
|
186
|
+
# end
|
187
|
+
#
|
188
|
+
# Twitter.post "Just run BigBench with #{total_trackings} trackings and #{total_errors} errors."
|
189
|
+
#
|
190
|
+
# end
|
191
|
+
#
|
192
|
+
def self.post_process processor = nil
|
193
|
+
raise PostProcessor::InvalidProcessor.new if processor.nil? && !block_given?
|
194
|
+
block_given? ? PostProcessor.add(&Proc.new) : PostProcessor.add(processor)
|
195
|
+
end
|
196
|
+
|
197
|
+
# List all initialized post processors
|
198
|
+
def self.post_processors
|
199
|
+
PostProcessor.all
|
200
|
+
end
|
201
|
+
|
202
|
+
# Runs all initialized post processors after the trackings have been written
|
203
|
+
def self.run_post_processors!
|
204
|
+
PostProcessor.run!
|
205
|
+
end
|
206
|
+
end
|