From 185af0ba39417fca4e612cbc50165018ca4a6c9f Mon Sep 17 00:00:00 2001 From: Louis Chatriot Date: Tue, 4 Jun 2013 09:44:17 +0200 Subject: [PATCH] Benchmark results in ops/s, not ms --- benchmarks/commonUtilities.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/benchmarks/commonUtilities.js b/benchmarks/commonUtilities.js index f812a54..9658826 100644 --- a/benchmarks/commonUtilities.js +++ b/benchmarks/commonUtilities.js @@ -65,7 +65,7 @@ module.exports.insertDocs = function (d, n, profiler, cb) { function runFrom(i) { if (i === n) { // Finished - console.log("Average time for one insert: " + (profiler.elapsedSinceLastStep() / n) + "ms"); + console.log("===== RESULT (insert) ===== " + Math.floor(1000* n / profiler.elapsedSinceLastStep()) + " ops/s"); profiler.step('Finished inserting ' + n + ' docs'); return cb(); } @@ -92,7 +92,7 @@ module.exports.findDocs = function (d, n, profiler, cb) { function runFrom(i) { if (i === n) { // Finished - console.log("Average time for one find in a collection of " + n + " docs: " + (profiler.elapsedSinceLastStep() / n) + "ms"); + console.log("===== RESULT (find) ===== " + Math.floor(1000* n / profiler.elapsedSinceLastStep()) + " ops/s"); profiler.step('Finished finding ' + n + ' docs'); return cb(); } @@ -120,7 +120,7 @@ module.exports.findOneDocs = function (d, n, profiler, cb) { function runFrom(i) { if (i === n) { // Finished - console.log("Average time for one findOne in a collection of " + n + " docs: " + (profiler.elapsedSinceLastStep() / n) + "ms"); + console.log("===== RESULT (findOne) ===== " + Math.floor(1000* n / profiler.elapsedSinceLastStep()) + " ops/s"); profiler.step('Finished finding ' + n + ' docs'); return cb(); } @@ -149,7 +149,7 @@ module.exports.updateDocs = function (options, d, n, profiler, cb) { function runFrom(i) { if (i === n) { // Finished - console.log("Average time for one update in a collection of " + n + " docs: " + (profiler.elapsedSinceLastStep() / n) + "ms"); + console.log("===== RESULT (update) ===== " + Math.floor(1000* n / profiler.elapsedSinceLastStep()) + " ops/s"); profiler.step('Finished updating ' + n + ' docs'); return cb(); } @@ -180,7 +180,7 @@ module.exports.removeDocs = function (options, d, n, profiler, cb) { function runFrom(i) { if (i === n) { // Finished - console.log("Average time for one remove and one insert in a collection of " + n + " docs: " + (profiler.elapsedSinceLastStep() / n) + "ms"); + console.log("===== RESULT (remove) ===== " + Math.floor(1000* n / profiler.elapsedSinceLastStep()) + " ops/s"); profiler.step('Finished removing ' + n + ' docs'); return cb(); } @@ -212,7 +212,7 @@ module.exports.loadDatabase = function (d, n, profiler, cb) { function runFrom(i) { if (i === n) { // Finished - console.log("Average time for one loadDatabse for a collection of " + n + " docs: " + (profiler.elapsedSinceLastStep() / n) + "ms"); + console.log("===== RESULT ===== " + Math.floor(1000* n / profiler.elapsedSinceLastStep()) + " ops/s"); profiler.step('Finished loading a database' + n + ' times'); return cb(); }