From 28c4f4b9ddbab49bd352946dc0b5bdd822e0a22a Mon Sep 17 00:00:00 2001 From: kpdecker Date: Sun, 25 Aug 2013 19:13:51 -0500 Subject: [PATCH] Output scaled throughput values to console --- bench/throughput.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/bench/throughput.js b/bench/throughput.js index 4865e5a6..67c2290b 100644 --- a/bench/throughput.js +++ b/bench/throughput.js @@ -135,6 +135,18 @@ module.exports = function(grunt, callback) { }); warmer.bench(function() { + grunt.log.writeln(); // Clear out any trailing contnet + + var scaled = {}; + _.each(warmer.times, function(times, name) { + var output = scaled[name] = {}; + + _.each(times, function(time, lang) { + output[lang] = ((time - warmer.minimum) / (warmer.maximum - warmer.minimum) * 100).toFixed(2); + }); + }); + grunt.log.writeln('Scaled throughput: ' + JSON.stringify(scaled, undefined, 2)); + callback && callback(warmer.times); }); };