@@ -25,13 +25,13 @@ function lpad(input, len, chr) {
25
25
26
26
metrics . Histogram . prototype . print_line = function ( ) {
27
27
var obj = this . printObj ( ) ;
28
-
28
+
29
29
return lpad ( obj . min , 4 ) + "/" + lpad ( obj . max , 4 ) + "/" + lpad ( obj . mean . toFixed ( 2 ) , 7 ) + "/" + lpad ( obj . p95 . toFixed ( 2 ) , 7 ) ;
30
30
} ;
31
31
32
32
function Test ( args ) {
33
33
this . args = args ;
34
-
34
+
35
35
this . callback = null ;
36
36
this . clients = [ ] ;
37
37
this . clients_ready = 0 ;
@@ -58,7 +58,7 @@ Test.prototype.run = function (callback) {
58
58
59
59
Test . prototype . new_client = function ( id ) {
60
60
var self = this , new_client ;
61
-
61
+
62
62
new_client = redis . createClient ( 6379 , "127.0.0.1" , this . client_options ) ;
63
63
new_client . create_time = Date . now ( ) ;
64
64
@@ -97,7 +97,7 @@ Test.prototype.fill_pipeline = function () {
97
97
pipeline ++ ;
98
98
this . send_next ( ) ;
99
99
}
100
-
100
+
101
101
if ( this . commands_completed === this . num_requests ) {
102
102
this . print_stats ( ) ;
103
103
this . stop_clients ( ) ;
@@ -106,7 +106,7 @@ Test.prototype.fill_pipeline = function () {
106
106
107
107
Test . prototype . stop_clients = function ( ) {
108
108
var self = this ;
109
-
109
+
110
110
this . clients . forEach ( function ( client , pos ) {
111
111
if ( pos === self . clients . length - 1 ) {
112
112
client . quit ( function ( err , res ) {
@@ -135,7 +135,7 @@ Test.prototype.send_next = function () {
135
135
136
136
Test . prototype . print_stats = function ( ) {
137
137
var duration = Date . now ( ) - this . test_start ;
138
-
138
+
139
139
console . log ( "min/max/avg/p95: " + this . command_latency . print_line ( ) + " " + lpad ( duration , 6 ) + "ms total, " +
140
140
lpad ( ( this . num_requests / ( duration / 1000 ) ) . toFixed ( 2 ) , 8 ) + " ops/sec" ) ;
141
141
} ;
0 commit comments