lib/express-statsd.js
function sendStats() {
      var key = req[options.requestKey];
      key = key ? key + '.' : '';

      // Status Code
      var statusCode = res.statusCode || 'unknown_status';
      client.increment(key + 'status_code.' + statusCode);

      // Response Time
      var duration = new Date().getTime() - startTime;
      client.timing(key + 'response_time', duration);

      cleanup();
    }
function sendStats() {
      var key = req[options.requestKey];
      key = key ? key + '.' : '';

      // Status Code
      var statusCode = res.statusCode || 'unknown_status';
      client.increment(key + 'status_code.' + statusCode);

      // Response Time
      var duration = new Date().getTime() - startTime;
      client.timing(key + 'response_time', duration);

      cleanup();
    }
function sendStats ( ) { var key = req [ options . requestKey ] ; key = key ? key + '.' : '' ; // Status Code var statusCode = res . statusCode || 'unknown_status' ; client . increment ( key + 'status_code.' + statusCode ) ; // Response Time var duration = new Date ( ) . getTime ( ) - startTime ; client . timing ( key + 'response_time' , duration ) ; cleanup ( ) ; }
Function called on response finish that sends stats to statsd
Function called on response finish that sends stats to statsd