drop database before doing benchmarking
This commit is contained in:
parent
7f5fce680e
commit
0818627108
|
@ -52,8 +52,9 @@ end
|
||||||
host = ENV['MONGO_RUBY_DRIVER_HOST'] || 'localhost'
|
host = ENV['MONGO_RUBY_DRIVER_HOST'] || 'localhost'
|
||||||
port = ENV['MONGO_RUBY_DRIVER_PORT'] || XGen::Mongo::Driver::Mongo::DEFAULT_PORT
|
port = ENV['MONGO_RUBY_DRIVER_PORT'] || XGen::Mongo::Driver::Mongo::DEFAULT_PORT
|
||||||
|
|
||||||
db = Mongo.new(host, port).db('ruby-benchmark')
|
connection = Mongo.new(host, port)
|
||||||
db.drop_collection('benchmark')
|
connection.drop_database("benchmark")
|
||||||
|
db = connection.db('benchmark')
|
||||||
|
|
||||||
insert = Proc.new { |coll, object, i|
|
insert = Proc.new { |coll, object, i|
|
||||||
object['x'] = i
|
object['x'] = i
|
||||||
|
|
Loading…
Reference in New Issue