Response time for Node.js servers.
This module creates a middleware that records the response time for requests in HTTP servers. The "response time" is defined here as the elapsed time from when a request enters this middleware to when the headers are written out to the client.
$ npm install response-time
var responseTime =
Create a middleware that adds a
X-Response-Time header to responses. If
you don't want to use this module to automatically set a header, please
see the section about
responseTime function accepts an optional
options object that may
contain any of the following keys:
The fixed number of digits to include in the output, which is always in
milliseconds, defaults to
The name of the header to set, defaults to
Boolean to indicate if units of measurement suffix should be added to
the output, defaults to
Create a new middleware that records the response time of a request and
makes this available to your own function
fn argument will be
fn(req, res, time), where
time is a number in milliseconds.
var express =var responseTime =var app =appapp
var finalhandler =var http =var responseTime =// create "middleware"var _responseTime =http
var express =var responseTime =var StatsD =var app =var stats =statssocketappapp