metrics.js
function Metrics(requests) {
  this.requests = requests;             // The total amount of requests send

  this.connections = 0;                 // Connections established
  this.disconnects = 0;                 // Closed connections
  this.failures = 0;                    // Connections that received an error

  this.errors = Object.create(null);    // Collection of different errors
  this.timing = Object.create(null);    // Different timings

  this.latency = new Stats();           // Latencies of the echo'd messages
  this.handshaking = new Stats();       // Handshake duration

  this.read = 0;                        // Bytes read
  this.send = 0;                        // Bytes send

  // Start tracking
  this.start();
}
function Metrics(requests) {
  this.requests = requests;             // The total amount of requests send

  this.connections = 0;                 // Connections established
  this.disconnects = 0;                 // Closed connections
  this.failures = 0;                    // Connections that received an error

  this.errors = Object.create(null);    // Collection of different errors
  this.timing = Object.create(null);    // Different timings

  this.latency = new Stats();           // Latencies of the echo'd messages
  this.handshaking = new Stats();       // Handshake duration

  this.read = 0;                        // Bytes read
  this.send = 0;                        // Bytes send

  // Start tracking
  this.start();
}
function Metrics ( requests ) { this . requests = requests ; // The total amount of requests send this . connections = 0 ; // Connections established this . disconnects = 0 ; // Closed connections this . failures = 0 ; // Connections that received an error this . errors = Object . create ( null ) ; // Collection of different errors this . timing = Object . create ( null ) ; // Different timings this . latency = new Stats ( ) ; // Latencies of the echo'd messages this . handshaking = new Stats ( ) ; // Handshake duration this . read = 0 ; // Bytes read this . send = 0 ; // Bytes send // Start tracking this . start ( ) ; }
Metrics collection and generation.

@constructor
@param {Number} requests The total amount of requests scheduled to be send
Metrics collection and generation .