From eb5bf52bd9be1f5b97aca748f574cb10462cf2dc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Garc=C3=ADa=20Aubert?= Date: Thu, 2 Nov 2017 10:22:30 +0100 Subject: [PATCH] Move profiler start to the right place --- lib/cartodb/controllers/map.js | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/lib/cartodb/controllers/map.js b/lib/cartodb/controllers/map.js index 901cc886..a50bc72e 100644 --- a/lib/cartodb/controllers/map.js +++ b/lib/cartodb/controllers/map.js @@ -113,6 +113,8 @@ MapController.prototype.register = function(app) { }; function createGetPrepareConfig (req, res, next) { + req.profiler.start('windshaft.createmap_get'); + const { config } = res.locals; if (!config) { @@ -129,6 +131,8 @@ function createGetPrepareConfig (req, res, next) { } function createPostPrepareConfig(req, res, next) { + req.profiler.start('windshaft.createmap_post'); + if (!req.is('application/json')) { return next(new Error('layergroup POST data must be of type application/json')); } @@ -137,6 +141,8 @@ function createPostPrepareConfig(req, res, next) { } function prepareTemplateParams(req, res, next) { + req.profiler.start('windshaft-cartodb.instance_template_post'); + if (!req.is('application/json')) { return next(new Error('Template POST data must be of type application/json')); } @@ -145,6 +151,8 @@ function prepareTemplateParams(req, res, next) { } function prepareJsonTemplateParams(req, res, next) { + req.profiler.start('windshaft-cartodb.instance_template_get'); + const { callback, config } = req.query; if (callback === undefined || callback.length === 0) { @@ -163,25 +171,18 @@ function prepareJsonTemplateParams(req, res, next) { } MapController.prototype.createGet = function(req, res, next){ - req.profiler.start('windshaft.createmap_get'); - this.create(req, res, next); }; MapController.prototype.createPost = function(req, res, next) { - req.profiler.start('windshaft.createmap_post'); - this.create(req, res, next); }; MapController.prototype.instantiate = function(req, res, next) { - req.profiler.start('windshaft-cartodb.instance_template_post'); - this.instantiateTemplate(req, res, next); }; MapController.prototype.jsonp = function(req, res, next) { - req.profiler.start('windshaft-cartodb.instance_template_get'); this.instantiateTemplate(req, res, next); };