Module: BigBench::Runner

Defined in:
lib/bigbench/runner.rb

Overview

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.

Defined Under Namespace

Classes: NoBenchmarksDefined

Class Method Summary collapse

Class Method Details

.run!Object

Runs all benchmarks



15
16
17
18
19
20
21
22
23
24
25
26
27
# File 'lib/bigbench/runner.rb', line 15

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