Skip to content

Commit

Permalink
Add a pipeline option for the tests
Browse files Browse the repository at this point in the history
  • Loading branch information
louischatriot committed Jun 4, 2013
1 parent de4de6c commit 518e5b8
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions benchmarks/insert.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,27 @@ 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;

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) {
Expand Down

0 comments on commit 518e5b8

Please sign in to comment.