UNPKG

shunter

Version:

A Node.js application built to read JSON and translate it into HTML

18 lines (13 loc) 384 B
'use strict'; module.exports = function(config) { var statsd = require('./statsd')(config); return function(req, res, next) { var timer = config.timer(); var end = res.end; res.end = function() { statsd.classifiedTiming(req.url, 'response_time', timer('Request completed ' + req.url)); end.apply(res, Array.prototype.slice.call(arguments, 0)); }; next(); }; };