From 1bf2809355a3af7087cbf06150f17bda8c7b8a37 Mon Sep 17 00:00:00 2001 From: Raul Ochoa Date: Tue, 14 Apr 2015 16:40:15 +0200 Subject: [PATCH 1/4] Do not check statsd_client in profiler --- lib/cartodb/controllers/template_maps.js | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/lib/cartodb/controllers/template_maps.js b/lib/cartodb/controllers/template_maps.js index bfc00f33..d9762702 100644 --- a/lib/cartodb/controllers/template_maps.js +++ b/lib/cartodb/controllers/template_maps.js @@ -136,7 +136,7 @@ TemplateMapsController.prototype.update = function(req, res) { TemplateMapsController.prototype.retrieve = function(req, res) { var self = this; - if ( req.profiler && req.profiler.statsd_client ) { + if (req.profiler) { req.profiler.start('windshaft-cartodb.get_template'); } @@ -198,7 +198,7 @@ TemplateMapsController.prototype.retrieve = function(req, res) { TemplateMapsController.prototype.destroy = function(req, res) { var self = this; - if ( req.profiler && req.profiler.statsd_client ) { + if (req.profiler) { req.profiler.start('windshaft-cartodb.delete_template'); } this.app.doCORS(res); @@ -250,8 +250,7 @@ TemplateMapsController.prototype.destroy = function(req, res) { // Get a list of owned templates TemplateMapsController.prototype.list = function(req, res) { var self = this; - - if ( req.profiler && req.profiler.statsd_client ) { + if ( req.profiler ) { req.profiler.start('windshaft-cartodb.get_template_list'); } this.app.doCORS(res); @@ -295,7 +294,7 @@ TemplateMapsController.prototype.list = function(req, res) { TemplateMapsController.prototype.instantiate = function(req, res) { var self = this; - if ( req.profiler && req.profiler.statsd_client) { + if (req.profiler) { req.profiler.start('windshaft-cartodb.instance_template_post'); } step( @@ -322,7 +321,7 @@ TemplateMapsController.prototype.options = function(req, res, next) { TemplateMapsController.prototype.jsonp = function(req, res) { var self = this; - if ( req.profiler && req.profiler.statsd_client) { + if (req.profiler) { req.profiler.start('windshaft-cartodb.instance_template_get'); } step( From 84f579f0ec830c79bd9dabcf350d84a500b79034 Mon Sep 17 00:00:00 2001 From: Raul Ochoa Date: Tue, 14 Apr 2015 16:41:04 +0200 Subject: [PATCH 2/4] Do not add x-profiler header as it's already added by sendResponse --- lib/cartodb/controllers/template_maps.js | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/lib/cartodb/controllers/template_maps.js b/lib/cartodb/controllers/template_maps.js index d9762702..eb3fcb7b 100644 --- a/lib/cartodb/controllers/template_maps.js +++ b/lib/cartodb/controllers/template_maps.js @@ -59,9 +59,6 @@ TemplateMapsController.prototype.create = function(req, res) { return { template_id: cdbuser + '@' + tpl_id }; }, function finish(err, response){ - if ( req.profiler ) { - res.header('X-Tiler-Profiler', req.profiler.toJSONString()); - } if (err){ response = { error: ''+err }; var statusCode = 400; @@ -115,9 +112,6 @@ TemplateMapsController.prototype.update = function(req, res) { return { template_id: cdbuser + '@' + tpl_id }; }, function finish(err, response){ - if ( req.profiler ) { - res.header('X-Tiler-Profiler', req.profiler.toJSONString()); - } if (err){ var statusCode = 400; response = { error: ''+err }; @@ -304,7 +298,7 @@ TemplateMapsController.prototype.instantiate = function(req, res) { } self.instantiateTemplate(req, res, req.body, this); }, function(err, response) { - self.finish_instantiation(err, response, res, req); + self.finish_instantiation(err, response, res); } ); }; @@ -339,7 +333,7 @@ TemplateMapsController.prototype.jsonp = function(req, res) { } self.instantiateTemplate(req, res, config, this); }, function(err, response) { - self.finish_instantiation(err, response, res, req); + self.finish_instantiation(err, response, res); } ); }; @@ -446,10 +440,7 @@ TemplateMapsController.prototype.instantiateTemplate = function(req, res, templa ); }; -TemplateMapsController.prototype.finish_instantiation = function(err, response, res, req) { - if ( req.profiler ) { - res.header('X-Tiler-Profiler', req.profiler.toJSONString()); - } +TemplateMapsController.prototype.finish_instantiation = function(err, response, res) { if (err) { var statusCode = 400; response = { error: ''+err }; From 0c578a193c4b5ad72cd75bf2d06a70384cdc050d Mon Sep 17 00:00:00 2001 From: Raul Ochoa Date: Tue, 14 Apr 2015 16:44:03 +0200 Subject: [PATCH 3/4] Remove stack for debug environment option --- lib/cartodb/controllers/template_maps.js | 3 --- 1 file changed, 3 deletions(-) diff --git a/lib/cartodb/controllers/template_maps.js b/lib/cartodb/controllers/template_maps.js index eb3fcb7b..be2022a8 100644 --- a/lib/cartodb/controllers/template_maps.js +++ b/lib/cartodb/controllers/template_maps.js @@ -447,9 +447,6 @@ TemplateMapsController.prototype.finish_instantiation = function(err, response, if ( ! _.isUndefined(err.http_status) ) { statusCode = err.http_status; } - if(global.environment.debug) { - response.stack = err.stack; - } this.app.sendError(res, response, statusCode, 'POST INSTANCE TEMPLATE', err); } else { this.app.sendResponse(res, [response, 200]); From e2fd4aca606058ae6e2121ad2b56bc366e4934ca Mon Sep 17 00:00:00 2001 From: Raul Ochoa Date: Wed, 15 Apr 2015 15:32:10 +0200 Subject: [PATCH 4/4] Upgrade windshaft --- NEWS.md | 6 ++++++ npm-shrinkwrap.json | 6 +++--- package.json | 2 +- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/NEWS.md b/NEWS.md index ce7e7d92..9a9f27c4 100644 --- a/NEWS.md +++ b/NEWS.md @@ -4,6 +4,12 @@ Released 2015-mm-dd +Bug fixes: + - Do not check statsd_client in profiler + +Announcements: + - Upgrades windshaft to [0.42.1](https://github.com/CartoDB/Windshaft/releases/tag/0.42.1) + ## 2.1.1 diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index 68fa6777..28bcd6ab 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -170,9 +170,9 @@ "resolved": "https://registry.npmjs.org/underscore/-/underscore-1.6.0.tgz" }, "windshaft": { - "version": "0.42.0", - "from": "windshaft@0.42.0", - "resolved": "https://registry.npmjs.org/windshaft/-/windshaft-0.42.0.tgz", + "version": "0.42.1", + "from": "windshaft@0.42.1", + "resolved": "https://registry.npmjs.org/windshaft/-/windshaft-0.42.1.tgz", "dependencies": { "chronograph": { "version": "0.1.0", diff --git a/package.json b/package.json index c580f69e..1aa4fe19 100644 --- a/package.json +++ b/package.json @@ -24,7 +24,7 @@ "dependencies": { "underscore" : "~1.6.0", "dot": "~1.0.2", - "windshaft": "0.42.0", + "windshaft": "0.42.1", "step": "~0.0.5", "queue-async": "~1.0.7", "request": "~2.9.203",