drop database before doing benchmarking

This commit is contained in:
Mike Dirolf 2009-03-24 12:01:08 -04:00
parent 7f5fce680e
commit 0818627108
1 changed files with 3 additions and 2 deletions

View File

@ -52,8 +52,9 @@ end
host = ENV['MONGO_RUBY_DRIVER_HOST'] || 'localhost'
port = ENV['MONGO_RUBY_DRIVER_PORT'] || XGen::Mongo::Driver::Mongo::DEFAULT_PORT
db = Mongo.new(host, port).db('ruby-benchmark')
db.drop_collection('benchmark')
connection = Mongo.new(host, port)
connection.drop_database("benchmark")
db = connection.db('benchmark')
insert = Proc.new { |coll, object, i|
object['x'] = i