diff options
author | Adam Ierymenko <adam.ierymenko@gmail.com> | 2015-11-10 17:15:06 -0800 |
---|---|---|
committer | Adam Ierymenko <adam.ierymenko@gmail.com> | 2015-11-10 17:15:06 -0800 |
commit | 53731acf51ffecafc52779cc8942b7fc4c143299 (patch) | |
tree | 8fbb2a04ef2126332fc089e5f6c9e68dcbe536ed | |
parent | 3b9411044fbc86bf9f4a64e22a11d4f4be2a1814 (diff) | |
download | infinitytier-53731acf51ffecafc52779cc8942b7fc4c143299.tar.gz infinitytier-53731acf51ffecafc52779cc8942b7fc4c143299.zip |
Bracket by time in result cruncher script.
-rw-r--r-- | tests/http/crunch-results.js | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/tests/http/crunch-results.js b/tests/http/crunch-results.js index 8da8915d..50e5c49a 100644 --- a/tests/http/crunch-results.js +++ b/tests/http/crunch-results.js @@ -3,8 +3,8 @@ // suitable for graphing. // -// Number of requests per statistical bracket -var BRACKET_SIZE = 1000; +// Time duration per statistical bracket +var BRACKET_SIZE = 10000; // Number of bytes expected from each test var EXPECTED_BYTES = 5000; @@ -23,6 +23,7 @@ var totalOverallFailures = 0.0; var totalMs = 0; var totalData = 0; var devices = {}; +var lastBracketTs = 0; rl.on('line',function(line) { line = line.trim(); @@ -48,13 +49,17 @@ rl.on('line',function(line) { devices[fromId] = true; devices[toId] = true; - if (count >= BRACKET_SIZE) { + if (lastBracketTs === 0) + lastBracketTs = ts; + + if (((ts - lastBracketTs) >= BRACKET_SIZE)&&(count > 0.0)) { console.log(count.toString()+','+overallCount.toString()+','+(totalMs / count)+','+(totalFailures / count)+','+(totalOverallFailures / overallCount)+','+totalData+','+Object.keys(devices).length); count = 0.0; totalFailures = 0.0; totalMs = 0; totalData = 0; + lastBracketTs = ts; } } // else ignore junk }); |