From 0818627108baaec327fba0bf07e42d3c5a8ea980 Mon Sep 17 00:00:00 2001 From: Mike Dirolf Date: Tue, 24 Mar 2009 12:01:08 -0400 Subject: [PATCH] drop database before doing benchmarking --- bin/standard_benchmark | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/bin/standard_benchmark b/bin/standard_benchmark index 417e1c1..2363f86 100755 --- a/bin/standard_benchmark +++ b/bin/standard_benchmark @@ -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