Sha256: 389cd49246e68dd49fe832960e971256f836d91088fbeccd153fbc370e4ad006
Contents?: true
Size: 1.36 KB
Versions: 3
Compression:
Stored size: 1.36 KB
Contents
module BigBench # The runner runs all available benchmarks and returns as soon as all of them are finished. Additionally it allows the loading # of reciepts from files or the redis storage. module Runner # Is thrown when no benchmarks are defined class NoBenchmarksDefined < StandardError def message "Sorry, I couldn't find any benchmarks!" end end # Runs all benchmarks def self.run! raise NoBenchmarksDefined.new if BigBench.benchmarks.empty? # Run all benchmarks EventMachine.run { # Start Timer Thread.new { sleep(BigBench.duration.to_i); EventMachine.stop } # Start Benchmarks BigBench.benchmarks.each{ |benchmark| benchmark.run! } } end end # Runs all initialized benchmarks def self.run! BigBench::Output.running_benchmarks Runner.run! BigBench::Output.finished_running_benchmarks end # Loads a test from a string file that is either parsed from a local file or retreived from the key-value store. # # benchmark_string = 'benchmark "index page" => "http://localhost:3000" do # get "/" # end' # # BigBench.load_test!(benchmark_string) # def self.load_test!(test) BigBench::Benchmark.reset! eval(test) check_config! BigBench::Output.loaded_tests end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
bigbench-0.0.4 | lib/bigbench/runner.rb |
bigbench-0.0.3 | lib/bigbench/runner.rb |
bigbench-0.0.2 | lib/bigbench/runner.rb |