Created
August 26, 2014 03:17
-
-
Save mridgway/5c79169a827892fec6bb to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/lib/route.js b/lib/route.js | |
index 673bc7c..86835f1 100644 | |
--- a/lib/route.js | |
+++ b/lib/route.js | |
@@ -183,7 +183,8 @@ function getResourceRoute(stores) { | |
function postRoute(stores) { | |
return function (req, res) { | |
- var api_requests = {}, | |
+ var timer = req.perf.start(req.id || 'td-api', 'xhr_lifetime'), | |
+ api_requests = {}, | |
requests = req.body.requests; | |
Object.keys(requests).forEach(function (id) { | |
@@ -238,6 +239,7 @@ function postRoute(stores) { | |
async.parallel(api_requests, function (err, results) { | |
res.set(response_defaults); | |
res.json(200, results); | |
+ timer.stop(); | |
if (req.query.perf) { | |
console.log(req.perf.output()); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment