From 7580081a643d410efebb5db212c771aa7cd0456f Mon Sep 17 00:00:00 2001 From: Raul Ochoa Date: Tue, 28 Apr 2015 16:14:30 +0200 Subject: [PATCH] Append stats to profiler --- lib/cartodb/controllers/named_static_maps.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/cartodb/controllers/named_static_maps.js b/lib/cartodb/controllers/named_static_maps.js index b1395eb0..9f604a08 100644 --- a/lib/cartodb/controllers/named_static_maps.js +++ b/lib/cartodb/controllers/named_static_maps.js @@ -181,7 +181,12 @@ NamedStaticMapsController.prototype.named = function(req, res) { self.staticMapBackend.getImage(staticImageReq, width, height, imageOpts.bounds, this); } }, - function handleImage(err, image, headers/*, stats*/) { + function handleImage(err, image, headers, stats) { + if (req.profiler) { + req.profiler.done('render-' + format); + req.profiler.add(stats || {}); + } + if (err) { if (!err.error) { err.error = err.message;