1
0
mirror of https://github.com/redis/node-redis.git synced 2025-08-06 02:15:48 +03:00

Move parsers into seperate module and improve js parser performance

This commit is contained in:
Ruben Bridgewater
2015-11-30 12:59:30 +01:00
parent 0207163655
commit 16a1d69c82
10 changed files with 91 additions and 650 deletions

View File

@@ -42,7 +42,7 @@ function lpad(input, len, chr) {
metrics.Histogram.prototype.print_line = function () {
var obj = this.printObj();
return lpad(obj.min, 4) + '/' + lpad(obj.max, 4) + '/' + lpad(obj.mean.toFixed(2), 7) + '/' + lpad(obj.p95.toFixed(2), 7);
return lpad(obj.min, 4) + '/' + lpad(obj.max, 4) + '/' + lpad(obj.mean.toFixed(2), 7);
};
function Test(args) {
@@ -205,7 +205,7 @@ Test.prototype.print_stats = function () {
var duration = Date.now() - this.test_start;
totalTime += duration;
console.log('min/max/avg/p95: ' + this.command_latency.print_line() + ' ' + lpad(duration, 6) + 'ms total, ' +
console.log('min/max/avg: ' + this.command_latency.print_line() + ' ' + lpad(duration, 6) + 'ms total, ' +
lpad((this.commands_completed / (duration / 1000)).toFixed(2), 9) + ' ops/sec');
};