Add a pipeline option for the tests

pull/2/head
Louis Chatriot 12 years ago
parent de4de6c405
commit 518e5b8285
  1. 8
      benchmarks/insert.js

@ -4,14 +4,15 @@ var Datastore = require('../lib/datastore')
, commonUtilities = require('./commonUtilities') , commonUtilities = require('./commonUtilities')
, execTime = require('exec-time') , execTime = require('exec-time')
, profiler = new execTime('INSERT BENCH') , profiler = new execTime('INSERT BENCH')
, d = new Datastore(benchDb) , d
, program = require('commander') , program = require('commander')
, n , n
; ;
program program
.option('-n --number [number]', 'Size of the collection to test on', parseInt) .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); .parse(process.argv);
n = program.number || 10000; n = program.number || 10000;
@ -19,8 +20,11 @@ n = program.number || 10000;
console.log("----------------------------"); console.log("----------------------------");
console.log("Test with " + n + " documents"); console.log("Test with " + n + " documents");
console.log(program.withIndex ? "Use an index" : "Don't use an index"); 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("----------------------------"); console.log("----------------------------");
d = new Datastore({ filename: benchDb, pipeline: program.withPipeline });
async.waterfall([ async.waterfall([
async.apply(commonUtilities.prepareDb, benchDb) async.apply(commonUtilities.prepareDb, benchDb)
, function (cb) { , function (cb) {

Loading…
Cancel
Save