From 518e5b82857c67092c964d31c6f0f5ba6e628277 Mon Sep 17 00:00:00 2001 From: Louis Chatriot Date: Tue, 4 Jun 2013 11:52:46 +0200 Subject: [PATCH] Add a pipeline option for the tests --- benchmarks/insert.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/benchmarks/insert.js b/benchmarks/insert.js index 86ba8ce..faac99b 100644 --- a/benchmarks/insert.js +++ b/benchmarks/insert.js @@ -4,14 +4,15 @@ var Datastore = require('../lib/datastore') , commonUtilities = require('./commonUtilities') , execTime = require('exec-time') , profiler = new execTime('INSERT BENCH') - , d = new Datastore(benchDb) + , d , program = require('commander') , n ; program .option('-n --number [number]', 'Size of the collection to test on', parseInt) - .option('-i --with-index', 'Test with an index') + .option('-i --with-index', 'Use an index') + .option('-p --with-pipeline', 'Use pipelining') .parse(process.argv); n = program.number || 10000; @@ -19,8 +20,11 @@ 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(program.withPipeline ? "Use an pipelining" : "Don't use pipelining"); console.log("----------------------------"); +d = new Datastore({ filename: benchDb, pipeline: program.withPipeline }); + async.waterfall([ async.apply(commonUtilities.prepareDb, benchDb) , function (cb) {