bigbench 0.0.1

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 (92) hide show
  1. data/.gitignore +5 -0
  2. data/Gemfile +4 -0
  3. data/README.textile +81 -0
  4. data/Rakefile +10 -0
  5. data/bigbench.gemspec +29 -0
  6. data/bin/bigbench +6 -0
  7. data/doc/BigBench.html +631 -0
  8. data/doc/BigBench/Benchmark.html +328 -0
  9. data/doc/BigBench/Benchmark/Benchmark.html +431 -0
  10. data/doc/BigBench/Bot.html +233 -0
  11. data/doc/BigBench/Configuration.html +312 -0
  12. data/doc/BigBench/Configuration/Config.html +375 -0
  13. data/doc/BigBench/Configuration/InvalidOptions.html +217 -0
  14. data/doc/BigBench/Executor.html +252 -0
  15. data/doc/BigBench/Executor/InvalidCommand.html +222 -0
  16. data/doc/BigBench/Fragment.html +404 -0
  17. data/doc/BigBench/Fragment/Fragment.html +384 -0
  18. data/doc/BigBench/Output.html +703 -0
  19. data/doc/BigBench/Runner.html +222 -0
  20. data/doc/BigBench/Runner/NoBenchmarksDefined.html +217 -0
  21. data/doc/BigBench/Store.html +639 -0
  22. data/doc/BigBench/Tracker.html +179 -0
  23. data/doc/BigBench/Tracker/Tracker.html +273 -0
  24. data/doc/Float.html +217 -0
  25. data/doc/Gemfile.html +129 -0
  26. data/doc/Helpers.html +163 -0
  27. data/doc/Object.html +181 -0
  28. data/doc/Rakefile.html +136 -0
  29. data/doc/TestWebServer.html +247 -0
  30. data/doc/created.rid +31 -0
  31. data/doc/images/add.png +0 -0
  32. data/doc/images/brick.png +0 -0
  33. data/doc/images/brick_link.png +0 -0
  34. data/doc/images/bug.png +0 -0
  35. data/doc/images/bullet_black.png +0 -0
  36. data/doc/images/bullet_toggle_minus.png +0 -0
  37. data/doc/images/bullet_toggle_plus.png +0 -0
  38. data/doc/images/date.png +0 -0
  39. data/doc/images/delete.png +0 -0
  40. data/doc/images/find.png +0 -0
  41. data/doc/images/loadingAnimation.gif +0 -0
  42. data/doc/images/macFFBgHack.png +0 -0
  43. data/doc/images/package.png +0 -0
  44. data/doc/images/page_green.png +0 -0
  45. data/doc/images/page_white_text.png +0 -0
  46. data/doc/images/page_white_width.png +0 -0
  47. data/doc/images/plugin.png +0 -0
  48. data/doc/images/ruby.png +0 -0
  49. data/doc/images/tag_blue.png +0 -0
  50. data/doc/images/tag_green.png +0 -0
  51. data/doc/images/transparent.png +0 -0
  52. data/doc/images/wrench.png +0 -0
  53. data/doc/images/wrench_orange.png +0 -0
  54. data/doc/images/zoom.png +0 -0
  55. data/doc/index.html +122 -0
  56. data/doc/js/darkfish.js +153 -0
  57. data/doc/js/jquery.js +18 -0
  58. data/doc/js/navigation.js +142 -0
  59. data/doc/js/search.js +94 -0
  60. data/doc/js/search_index.js +1 -0
  61. data/doc/js/searcher.js +228 -0
  62. data/doc/lib/bigbench/help/executor_txt.html +145 -0
  63. data/doc/rdoc.css +543 -0
  64. data/doc/table_of_contents.html +263 -0
  65. data/lib/bigbench.rb +18 -0
  66. data/lib/bigbench/benchmark.rb +126 -0
  67. data/lib/bigbench/bot.rb +34 -0
  68. data/lib/bigbench/configuration.rb +109 -0
  69. data/lib/bigbench/executor.rb +131 -0
  70. data/lib/bigbench/float_extensions.rb +6 -0
  71. data/lib/bigbench/fragment.rb +119 -0
  72. data/lib/bigbench/help/executor.txt +17 -0
  73. data/lib/bigbench/initializers.rb +2 -0
  74. data/lib/bigbench/output.rb +116 -0
  75. data/lib/bigbench/runner.rb +52 -0
  76. data/lib/bigbench/store.rb +92 -0
  77. data/lib/bigbench/tracker.rb +79 -0
  78. data/lib/bigbench/version.rb +3 -0
  79. data/spec/benchmark_spec.rb +69 -0
  80. data/spec/bot_spec.rb +31 -0
  81. data/spec/configure_spec.rb +39 -0
  82. data/spec/executor_spec.rb +80 -0
  83. data/spec/fragment_spec.rb +110 -0
  84. data/spec/helpers.rb +19 -0
  85. data/spec/lib/test_web_server.rb +18 -0
  86. data/spec/runner_spec.rb +40 -0
  87. data/spec/store_spec.rb +72 -0
  88. data/spec/tests/local.rb +15 -0
  89. data/spec/tests/local_invalid.rb +9 -0
  90. data/spec/tracker_spec.rb +50 -0
  91. data/spec/webserver_spec.rb +35 -0
  92. metadata +220 -0
@@ -0,0 +1,94 @@
1
+ Search = function(data, input, result) {
2
+ this.data = data;
3
+ this.$input = $(input);
4
+ this.$result = $(result);
5
+
6
+ this.$current = null;
7
+ this.$view = this.$result.parent();
8
+ this.searcher = new Searcher(data.index);
9
+ this.init();
10
+ }
11
+
12
+ Search.prototype = $.extend({}, Navigation, new function() {
13
+ var suid = 1;
14
+
15
+ this.init = function() {
16
+ var _this = this;
17
+ var observer = function() {
18
+ _this.search(_this.$input[0].value);
19
+ };
20
+ this.$input.keyup(observer);
21
+ this.$input.click(observer); // mac's clear field
22
+
23
+ this.searcher.ready(function(results, isLast) {
24
+ _this.addResults(results, isLast);
25
+ })
26
+
27
+ this.initNavigation();
28
+ this.setNavigationActive(false);
29
+ }
30
+
31
+ this.search = function(value, selectFirstMatch) {
32
+ value = jQuery.trim(value).toLowerCase();
33
+ if (value) {
34
+ this.setNavigationActive(true);
35
+ } else {
36
+ this.setNavigationActive(false);
37
+ }
38
+
39
+ if (value == '') {
40
+ this.lastQuery = value;
41
+ this.$result.empty();
42
+ this.setNavigationActive(false);
43
+ } else if (value != this.lastQuery) {
44
+ this.lastQuery = value;
45
+ this.firstRun = true;
46
+ this.searcher.find(value);
47
+ }
48
+ }
49
+
50
+ this.addResults = function(results, isLast) {
51
+ var target = this.$result.get(0);
52
+ if (this.firstRun && (results.length > 0 || isLast)) {
53
+ this.$current = null;
54
+ this.$result.empty();
55
+ }
56
+
57
+ for (var i=0, l = results.length; i < l; i++) {
58
+ target.appendChild(this.renderItem.call(this, results[i]));
59
+ };
60
+
61
+ if (this.firstRun && results.length > 0) {
62
+ this.firstRun = false;
63
+ this.$current = $(target.firstChild);
64
+ this.$current.addClass('current');
65
+ }
66
+ if (jQuery.browser.msie) this.$element[0].className += '';
67
+ }
68
+
69
+ this.move = function(isDown) {
70
+ if (!this.$current) return;
71
+ var $next = this.$current[isDown ? 'next' : 'prev']();
72
+ if ($next.length) {
73
+ this.$current.removeClass('current');
74
+ $next.addClass('current');
75
+ this.scrollIntoView($next[0], this.$view[0]);
76
+ this.$current = $next;
77
+ }
78
+ return true;
79
+ }
80
+
81
+ this.hlt = function(html) {
82
+ return this.escapeHTML(html).
83
+ replace(/\u0001/g, '<em>').
84
+ replace(/\u0002/g, '</em>');
85
+ }
86
+
87
+ this.escapeHTML = function(html) {
88
+ return html.replace(/[&<>]/g, function(c) {
89
+ return '&#' + c.charCodeAt(0) + ';';
90
+ });
91
+ }
92
+
93
+ });
94
+
@@ -0,0 +1 @@
1
+ var search_data = {"index":{"searchIndex":["bigbench","benchmark","benchmark","bot","configuration","config","invalidoptions","executor","invalidcommand","fragment","fragment","output","runner","nobenchmarksdefined","store","tracker","tracker","float","helpers","object","testwebserver","add()","add_option()","add_tracking()","all()","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()","max_duration()","message()","message()","message()","new()","new()","new()","new()","parse()","pop_tracking()","post()","put()","reset()","reset!()","reset!()","reset!()","reset!()","run!()","run!()","run!()","run!()","run!()","running?()","running_benchmarks()","running_bots_loop()","setup!()","start()","start()","start()","starting_bots_loop()","stop()","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::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","float","helpers","object","testwebserver","bigbench::benchmark::add()","bigbench::configuration::config::add_option()","bigbench::store::add_tracking()","bigbench::benchmark::all()","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::max_duration()","bigbench::configuration::invalidoptions#message()","bigbench::executor::invalidcommand#message()","bigbench::runner::nobenchmarksdefined#message()","bigbench::benchmark::benchmark::new()","bigbench::configuration::config::new()","bigbench::fragment::fragment::new()","bigbench::tracker::tracker::new()","bigbench::fragment::parse()","bigbench::store::pop_tracking()","bigbench::fragment::post()","bigbench::fragment::put()","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()","testwebserver::start()","bigbench::output::starting_bots_loop()","bigbench::store::stop()","testwebserver::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::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","",""],["Float","","Float.html","","<p>Adds the <code>to_milliseconds</code> method to any float value\n"],["Helpers","","Helpers.html","",""],["Object","","Object.html","",""],["TestWebServer","","TestWebServer.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"],["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\">&quot;default website pages&quot;</span> =<span class=\"ruby-operator\">&gt;</span> <span class=\"ruby-string\">&quot;http://localhost:3000&quot;</span> <span class=\"ruby-keyword\">do</span>\n <span class=\"ruby-identifier\">get</span> <span class=\"ruby-string\">&quot;/&quot;</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\"># =&gt; 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 class=\"ruby\"><span class=\"ruby-constant\">BigBench</span>.<span class=\"ruby-identifier\">configure</span> = {\n :<span class=\"ruby-identifier\">duration</span> =<span class=\"ruby-operator\">&gt;</span> <span class=\"ruby-operator\">...</span>\n</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, params = {})","<p>Performs a DELETE request to the given url, e.g.\n\n<pre class=\"ruby\"><span class=\"ruby-identifier\">delete</span> <span class=\"ruby-string\">&quot;/books/5&quot;</span>, { :<span class=\"ruby-identifier\">user</span> =<span class=\"ruby-operator\">&gt;</span> <span class=\"ruby-string\">&quot;some@sample.com&quot;</span>, :<span class=\"ruby-identifier\">password</span> <span class=\"ruby-operator\">...</span>\n</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)","<p>Performs a GET request to the given url, e.g.\n\n<pre>get &quot;/some/page&quot;</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","()",""],["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::Configuration::Config","BigBench/Configuration/Config.html#method-c-new","()",""],["new","BigBench::Fragment::Fragment","BigBench/Fragment/Fragment.html#method-c-new","(benchmark, path, method, params = {})",""],["new","BigBench::Tracker::Tracker","BigBench/Tracker/Tracker.html#method-c-new","()",""],["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, params = {})","<p>Performs a POST request to the given url, e.g.\n\n<pre class=\"ruby\"><span class=\"ruby-identifier\">post</span> <span class=\"ruby-string\">&quot;/login&quot;</span>, { :<span class=\"ruby-identifier\">user</span> =<span class=\"ruby-operator\">&gt;</span> <span class=\"ruby-string\">&quot;some@sample.com&quot;</span>, :<span class=\"ruby-identifier\">password</span> <span class=\"ruby-operator\">...</span>\n</pre>\n"],["put","BigBench::Fragment","BigBench/Fragment.html#method-c-put","(path, params = {})","<p>Performs a PUT request to the given url, e.g.\n\n<pre class=\"ruby\"><span class=\"ruby-identifier\">put</span> <span class=\"ruby-string\">&quot;/books&quot;</span>, { :<span class=\"ruby-identifier\">book</span> =<span class=\"ruby-operator\">&gt;</span> <span class=\"ruby-string\">&quot;Some book content&quot;</span> }\n</pre>\n"],["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","(http)","<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"],["start","TestWebServer","TestWebServer.html#method-c-start","()",""],["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"],["stop","TestWebServer","TestWebServer.html#method-c-stop","()",""],["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, response)","<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”\n<p>namespace :bigbench do\n\n<pre>desc &quot;Create and open documentation&quot;\ntask ...</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"]]}}
@@ -0,0 +1,228 @@
1
+ Searcher = function(data) {
2
+ this.data = data;
3
+ this.handlers = [];
4
+ }
5
+
6
+ Searcher.prototype = new function() {
7
+ // search is performed in chunks of 1000 for non-blocking user input
8
+ var CHUNK_SIZE = 1000;
9
+ // do not try to find more than 100 results
10
+ var MAX_RESULTS = 100;
11
+ var huid = 1;
12
+ var suid = 1;
13
+ var runs = 0;
14
+
15
+ this.find = function(query) {
16
+ var queries = splitQuery(query);
17
+ var regexps = buildRegexps(queries);
18
+ var highlighters = buildHilighters(queries);
19
+ var state = { from: 0, pass: 0, limit: MAX_RESULTS, n: suid++};
20
+ var _this = this;
21
+
22
+ this.currentSuid = state.n;
23
+
24
+ if (!query) return;
25
+
26
+ var run = function() {
27
+ // stop current search thread if new search started
28
+ if (state.n != _this.currentSuid) return;
29
+
30
+ var results =
31
+ performSearch(_this.data, regexps, queries, highlighters, state);
32
+ var hasMore = (state.limit > 0 && state.pass < 4);
33
+
34
+ triggerResults.call(_this, results, !hasMore);
35
+ if (hasMore) {
36
+ setTimeout(run, 2);
37
+ }
38
+ runs++;
39
+ };
40
+ runs = 0;
41
+
42
+ // start search thread
43
+ run();
44
+ }
45
+
46
+ /* ----- Events ------ */
47
+ this.ready = function(fn) {
48
+ fn.huid = huid;
49
+ this.handlers.push(fn);
50
+ }
51
+
52
+ /* ----- Utilities ------ */
53
+ function splitQuery(query) {
54
+ return jQuery.grep(query.split(/(\s+|::?|\(\)?)/), function(string) {
55
+ return string.match(/\S/)
56
+ });
57
+ }
58
+
59
+ function buildRegexps(queries) {
60
+ return jQuery.map(queries, function(query) {
61
+ return new RegExp(query.replace(/(.)/g, '([$1])([^$1]*?)'), 'i')
62
+ });
63
+ }
64
+
65
+ function buildHilighters(queries) {
66
+ return jQuery.map(queries, function(query) {
67
+ return jQuery.map(query.split(''), function(l, i) {
68
+ return '\u0001$' + (i*2+1) + '\u0002$' + (i*2+2);
69
+ }).join('');
70
+ });
71
+ }
72
+
73
+ // function longMatchRegexp(index, longIndex, regexps) {
74
+ // for (var i = regexps.length - 1; i >= 0; i--){
75
+ // if (!index.match(regexps[i]) && !longIndex.match(regexps[i])) return false;
76
+ // };
77
+ // return true;
78
+ // }
79
+
80
+
81
+ /* ----- Mathchers ------ */
82
+
83
+ /*
84
+ * This record matches if the index starts with queries[0] and the record
85
+ * matches all of the regexps
86
+ */
87
+ function matchPassBeginning(index, longIndex, queries, regexps) {
88
+ if (index.indexOf(queries[0]) != 0) return false;
89
+ for (var i=1, l = regexps.length; i < l; i++) {
90
+ if (!index.match(regexps[i]) && !longIndex.match(regexps[i]))
91
+ return false;
92
+ };
93
+ return true;
94
+ }
95
+
96
+ /*
97
+ * This record matches if the longIndex starts with queries[0] and the
98
+ * longIndex matches all of the regexps
99
+ */
100
+ function matchPassLongIndex(index, longIndex, queries, regexps) {
101
+ if (longIndex.indexOf(queries[0]) != 0) return false;
102
+ for (var i=1, l = regexps.length; i < l; i++) {
103
+ if (!longIndex.match(regexps[i]))
104
+ return false;
105
+ };
106
+ return true;
107
+ }
108
+
109
+ /*
110
+ * This record matches if the index contains queries[0] and the record
111
+ * matches all of the regexps
112
+ */
113
+ function matchPassContains(index, longIndex, queries, regexps) {
114
+ if (index.indexOf(queries[0]) == -1) return false;
115
+ for (var i=1, l = regexps.length; i < l; i++) {
116
+ if (!index.match(regexps[i]) && !longIndex.match(regexps[i]))
117
+ return false;
118
+ };
119
+ return true;
120
+ }
121
+
122
+ /*
123
+ * This record matches if regexps[0] matches the index and the record
124
+ * matches all of the regexps
125
+ */
126
+ function matchPassRegexp(index, longIndex, queries, regexps) {
127
+ if (!index.match(regexps[0])) return false;
128
+ for (var i=1, l = regexps.length; i < l; i++) {
129
+ if (!index.match(regexps[i]) && !longIndex.match(regexps[i]))
130
+ return false;
131
+ };
132
+ return true;
133
+ }
134
+
135
+
136
+ /* ----- Highlighters ------ */
137
+ function highlightRegexp(info, queries, regexps, highlighters) {
138
+ var result = createResult(info);
139
+ for (var i=0, l = regexps.length; i < l; i++) {
140
+ result.title = result.title.replace(regexps[i], highlighters[i]);
141
+ result.namespace = result.namespace.replace(regexps[i], highlighters[i]);
142
+ };
143
+ return result;
144
+ }
145
+
146
+ function hltSubstring(string, pos, length) {
147
+ return string.substring(0, pos) + '\u0001' + string.substring(pos, pos + length) + '\u0002' + string.substring(pos + length);
148
+ }
149
+
150
+ function highlightQuery(info, queries, regexps, highlighters) {
151
+ var result = createResult(info);
152
+ var pos = 0;
153
+ var lcTitle = result.title.toLowerCase();
154
+
155
+ pos = lcTitle.indexOf(queries[0]);
156
+ if (pos != -1) {
157
+ result.title = hltSubstring(result.title, pos, queries[0].length);
158
+ }
159
+
160
+ result.namespace = result.namespace.replace(regexps[0], highlighters[0]);
161
+ for (var i=1, l = regexps.length; i < l; i++) {
162
+ result.title = result.title.replace(regexps[i], highlighters[i]);
163
+ result.namespace = result.namespace.replace(regexps[i], highlighters[i]);
164
+ };
165
+ return result;
166
+ }
167
+
168
+ function createResult(info) {
169
+ var result = {};
170
+ result.title = info[0];
171
+ result.namespace = info[1];
172
+ result.path = info[2];
173
+ result.params = info[3];
174
+ result.snippet = info[4];
175
+ return result;
176
+ }
177
+
178
+ /* ----- Searching ------ */
179
+ function performSearch(data, regexps, queries, highlighters, state) {
180
+ var searchIndex = data.searchIndex;
181
+ var longSearchIndex = data.longSearchIndex;
182
+ var info = data.info;
183
+ var result = [];
184
+ var i = state.from;
185
+ var l = searchIndex.length;
186
+ var togo = CHUNK_SIZE;
187
+ var matchFunc, hltFunc;
188
+
189
+ while (state.pass < 4 && state.limit > 0 && togo > 0) {
190
+ if (state.pass == 0) {
191
+ matchFunc = matchPassBeginning;
192
+ hltFunc = highlightQuery;
193
+ } else if (state.pass == 1) {
194
+ matchFunc = matchPassLongIndex;
195
+ hltFunc = highlightQuery;
196
+ } else if (state.pass == 2) {
197
+ matchFunc = matchPassContains;
198
+ hltFunc = highlightQuery;
199
+ } else if (state.pass == 3) {
200
+ matchFunc = matchPassRegexp;
201
+ hltFunc = highlightRegexp;
202
+ }
203
+
204
+ for (; togo > 0 && i < l && state.limit > 0; i++, togo--) {
205
+ if (info[i].n == state.n) continue;
206
+ if (matchFunc(searchIndex[i], longSearchIndex[i], queries, regexps)) {
207
+ info[i].n = state.n;
208
+ result.push(hltFunc(info[i], queries, regexps, highlighters));
209
+ state.limit--;
210
+ }
211
+ };
212
+ if (searchIndex.length <= i) {
213
+ state.pass++;
214
+ i = state.from = 0;
215
+ } else {
216
+ state.from = i;
217
+ }
218
+ }
219
+ return result;
220
+ }
221
+
222
+ function triggerResults(results, isLast) {
223
+ jQuery.each(this.handlers, function(i, fn) {
224
+ fn.call(this, results, isLast)
225
+ })
226
+ }
227
+ }
228
+
@@ -0,0 +1,145 @@
1
+ <!DOCTYPE html>
2
+
3
+ <html>
4
+ <head>
5
+ <meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
6
+
7
+ <title>executor - RDoc Documentation</title>
8
+
9
+ <link type="text/css" media="screen" href="../../../rdoc.css" rel="stylesheet">
10
+
11
+ <script type="text/javascript">
12
+ var rdoc_rel_prefix = "../../../";
13
+ </script>
14
+
15
+ <script type="text/javascript" charset="utf-8" src="../../../js/jquery.js"></script>
16
+ <script type="text/javascript" charset="utf-8" src="../../../js/navigation.js"></script>
17
+ <script type="text/javascript" charset="utf-8" src="../../../js/search_index.js"></script>
18
+ <script type="text/javascript" charset="utf-8" src="../../../js/search.js"></script>
19
+ <script type="text/javascript" charset="utf-8" src="../../../js/searcher.js"></script>
20
+ <script type="text/javascript" charset="utf-8" src="../../../js/darkfish.js"></script>
21
+
22
+
23
+ <body class="file">
24
+ <nav id="metadata">
25
+ <nav id="home-section" class="section">
26
+ <h3 class="section-header">
27
+ <a href="../../../index.html">Home</a>
28
+ <a href="../../../table_of_contents.html#classes">Classes</a>
29
+ <a href="../../../table_of_contents.html#methods">Methods</a>
30
+ </h3>
31
+ </nav>
32
+
33
+
34
+ <nav id="search-section" class="section project-section" class="initially-hidden">
35
+ <form action="#" method="get" accept-charset="utf-8">
36
+ <h3 class="section-header">
37
+ <input type="text" name="search" placeholder="Search" id="search-field"
38
+ title="Type to search, Up and Down to navigate, Enter to load">
39
+ </h3>
40
+ </form>
41
+
42
+ <ul id="search-results" class="initially-hidden"></ul>
43
+ </nav>
44
+
45
+
46
+ <div id="project-metadata">
47
+ <nav id="fileindex-section" class="section project-section">
48
+ <h3 class="section-header">Pages</h3>
49
+
50
+ <ul>
51
+
52
+ <li class="file"><a href="../../../Gemfile.html">Gemfile</a>
53
+
54
+ <li class="file"><a href="../../../Rakefile.html">Rakefile</a>
55
+
56
+ <li class="file"><a href="../../../lib/bigbench/help/executor_txt.html">executor</a>
57
+
58
+ </ul>
59
+ </nav>
60
+
61
+ <nav id="classindex-section" class="section project-section">
62
+ <h3 class="section-header">Class and Module Index</h3>
63
+
64
+ <ul class="link-list">
65
+
66
+ <li><a href="../../../BigBench.html">BigBench</a>
67
+
68
+ <li><a href="../../../BigBench/Benchmark.html">BigBench::Benchmark</a>
69
+
70
+ <li><a href="../../../BigBench/Benchmark/Benchmark.html">BigBench::Benchmark::Benchmark</a>
71
+
72
+ <li><a href="../../../BigBench/Bot.html">BigBench::Bot</a>
73
+
74
+ <li><a href="../../../BigBench/Configuration.html">BigBench::Configuration</a>
75
+
76
+ <li><a href="../../../BigBench/Configuration/Config.html">BigBench::Configuration::Config</a>
77
+
78
+ <li><a href="../../../BigBench/Configuration/InvalidOptions.html">BigBench::Configuration::InvalidOptions</a>
79
+
80
+ <li><a href="../../../BigBench/Executor.html">BigBench::Executor</a>
81
+
82
+ <li><a href="../../../BigBench/Executor/InvalidCommand.html">BigBench::Executor::InvalidCommand</a>
83
+
84
+ <li><a href="../../../BigBench/Fragment.html">BigBench::Fragment</a>
85
+
86
+ <li><a href="../../../BigBench/Fragment/Fragment.html">BigBench::Fragment::Fragment</a>
87
+
88
+ <li><a href="../../../BigBench/Output.html">BigBench::Output</a>
89
+
90
+ <li><a href="../../../BigBench/Runner.html">BigBench::Runner</a>
91
+
92
+ <li><a href="../../../BigBench/Runner/NoBenchmarksDefined.html">BigBench::Runner::NoBenchmarksDefined</a>
93
+
94
+ <li><a href="../../../BigBench/Store.html">BigBench::Store</a>
95
+
96
+ <li><a href="../../../BigBench/Tracker.html">BigBench::Tracker</a>
97
+
98
+ <li><a href="../../../BigBench/Tracker/Tracker.html">BigBench::Tracker::Tracker</a>
99
+
100
+ <li><a href="../../../Float.html">Float</a>
101
+
102
+ <li><a href="../../../Helpers.html">Helpers</a>
103
+
104
+ <li><a href="../../../Object.html">Object</a>
105
+
106
+ <li><a href="../../../TestWebServer.html">TestWebServer</a>
107
+
108
+ </ul>
109
+ </nav>
110
+
111
+ </div>
112
+ </nav>
113
+
114
+ <div id="documentation" class="description">
115
+
116
+ <p>Usage:</p>
117
+
118
+ <pre># Local Testing
119
+ bigbench run local PATH_TO_TEST # Runs a test from the local machine. No redis needed.
120
+
121
+ # Remote Testing
122
+ bigbench run bots PATH_TO_TEST [REDIS_URL_WITH_PORT REDIS_PASSWORD] # Deploys and starts the test on all bots
123
+ bigbench start bot [REDIS_URL_WITH_PORT REDIS_PASSWORD] # Starts a bot on a remote machine
124
+
125
+ # Reseting
126
+ bigbench reset all # Resets everything
127
+
128
+ # Help
129
+ bigbench --help || show help # Displays this help</pre>
130
+
131
+ <p>Options:</p>
132
+
133
+ <pre>REDIS_URL_WITH_PORT # Defaults to http://localhost:6379
134
+ REDIS_PASSWORD # Defaults to no password</pre>
135
+
136
+ </div>
137
+
138
+
139
+
140
+ <footer id="validator-badges">
141
+ <p><a href="http://validator.w3.org/check/referer">[Validate]</a>
142
+ <p>Generated by <a href="https://github.com/rdoc/rdoc">RDoc</a> 3.12.
143
+ <p>Generated with the <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish Rdoc Generator</a> 3.
144
+ </footer>
145
+