From e50351e08b512592adabe7524edcb83bc8e90217 Mon Sep 17 00:00:00 2001 From: Louis Chatriot Date: Sat, 1 Jun 2013 23:29:33 +0200 Subject: [PATCH] Typo --- benchmarks/ensureIndex.js | 2 +- benchmarks/loadDatabase.js | 15 +++++++++++++-- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/benchmarks/ensureIndex.js b/benchmarks/ensureIndex.js index 4bc1c08..1c3c43e 100644 --- a/benchmarks/ensureIndex.js +++ b/benchmarks/ensureIndex.js @@ -33,7 +33,7 @@ async.waterfall([ , function (cb) { var i; - profiler.step('Begin calling ensureIndex ' + n + ' docs'); + profiler.step('Begin calling ensureIndex ' + n + ' times'); for (i = 0; i < n; i += 1) { d.ensureIndex({ fieldName: 'docNumber' }); diff --git a/benchmarks/loadDatabase.js b/benchmarks/loadDatabase.js index ff6489a..46290ff 100644 --- a/benchmarks/loadDatabase.js +++ b/benchmarks/loadDatabase.js @@ -7,10 +7,21 @@ var Datastore = require('../lib/datastore') , execTime = require('exec-time') , profiler = new execTime('LOADDB BENCH') , d = new Datastore(benchDb) - , n = 10000 + , program = require('commander') + , n ; -if (process.argv[2]) { n = parseInt(process.argv[2], 10); } +program + .option('-n --number [number]', 'Size of the collection to test on', parseInt) + .option('-i --with-index', 'Test with an index') + .parse(process.argv); + +n = program.number || 10000; + +console.log("----------------------------"); +console.log("Test with " + n + " documents"); +console.log(program.withIndex ? "Use an index" : "Don't use an index"); +console.log("----------------------------"); async.waterfall([ async.apply(commonUtilities.prepareDb, benchDb)