Skip to content

Commit

Permalink
* making benchmarks friendly to missing backends
Browse files Browse the repository at this point in the history
  • Loading branch information
lpetre committed Apr 7, 2010
1 parent 93833cc commit 2ddebdb
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion benchmarks.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,20 @@

Delayed::Worker.logger = Logger.new('/dev/null')

BACKENDS = []
Dir.glob("#{File.dirname(__FILE__)}/spec/setup/*.rb") do |backend|
begin
backend = File.basename(backend, '.rb')
require "spec/setup/#{backend}"
BACKENDS << backend.to_sym
rescue LoadError
puts "Unable to load #{backend} backend! #{$!}"
end
end


Benchmark.bm(10) do |x|
[:active_record, :mongo_mapper, :data_mapper].each do |backend|
BACKENDS.each do |backend|
require "spec/setup/#{backend}"
Delayed::Worker.backend = backend

Expand Down

0 comments on commit 2ddebdb

Please sign in to comment.