Properly prefix statsd labels for all endpoints

CDB-1861 #resolve
Will be 100% complete with update of Windshaft to 0.19.3+
This commit is contained in:
Sandro Santilli
2014-03-03 16:24:20 +01:00
parent 6034f49f40
commit 7bc5bab432
2 changed files with 23 additions and 1 deletions
+4
View File
@@ -1,6 +1,10 @@
1.8.5 -- 2014-03-DD 1.8.5 -- 2014-03-DD
------------------- -------------------
Enhancements:
- Set statsd prefix for all endpoints
1.8.4 -- 2014-03-03 1.8.4 -- 2014-03-03
------------------- -------------------
+19 -1
View File
@@ -97,6 +97,9 @@ var CartodbWindshaft = function(serverOptions) {
* Helper to allow access to the layer to be used in the maps infowindow popup. * Helper to allow access to the layer to be used in the maps infowindow popup.
*/ */
ws.get(serverOptions.base_url + '/infowindow', function(req, res){ ws.get(serverOptions.base_url + '/infowindow', function(req, res){
if ( req.profiler && req.profiler.statsd_client ) {
req.profiler.start('windshaft-cartodb.get_infowindow');
}
ws.doCORS(res); ws.doCORS(res);
Step( Step(
function(){ function(){
@@ -118,6 +121,9 @@ var CartodbWindshaft = function(serverOptions) {
* Helper to allow access to metadata to be used in embedded maps. * Helper to allow access to metadata to be used in embedded maps.
*/ */
ws.get(serverOptions.base_url + '/map_metadata', function(req, res){ ws.get(serverOptions.base_url + '/map_metadata', function(req, res){
if ( req.profiler && req.profiler.statsd_client ) {
req.profiler.start('windshaft-cartodb.get_map_metadata');
}
ws.doCORS(res); ws.doCORS(res);
Step( Step(
function(){ function(){
@@ -139,6 +145,9 @@ var CartodbWindshaft = function(serverOptions) {
* TODO: Move? * TODO: Move?
*/ */
ws.del(serverOptions.base_url + '/flush_cache', function(req, res){ ws.del(serverOptions.base_url + '/flush_cache', function(req, res){
if ( req.profiler && req.profiler.statsd_client ) {
req.profiler.start('windshaft-cartodb.flush_cache');
}
ws.doCORS(res); ws.doCORS(res);
Step( Step(
function flushCache(){ function flushCache(){
@@ -273,6 +282,9 @@ var CartodbWindshaft = function(serverOptions) {
// Get a specific template // Get a specific template
ws.get(template_baseurl + '/:template_id', function(req, res) { ws.get(template_baseurl + '/:template_id', function(req, res) {
if ( req.profiler && req.profiler.statsd_client ) {
req.profiler.start('windshaft-cartodb.get_template');
}
ws.doCORS(res); ws.doCORS(res);
var that = this; var that = this;
var response = {}; var response = {};
@@ -330,7 +342,10 @@ var CartodbWindshaft = function(serverOptions) {
}); });
// Delete a specific template // Delete a specific template
ws.delete(template_baseurl + '/:template_id', function(req, res) { ws.del(template_baseurl + '/:template_id', function(req, res) {
if ( req.profiler && req.profiler.statsd_client ) {
req.profiler.start('windshaft-cartodb.delete_template');
}
ws.doCORS(res); ws.doCORS(res);
var that = this; var that = this;
var response = {}; var response = {};
@@ -381,6 +396,9 @@ var CartodbWindshaft = function(serverOptions) {
// Get a list of owned templates // Get a list of owned templates
ws.get(template_baseurl, function(req, res) { ws.get(template_baseurl, function(req, res) {
if ( req.profiler && req.profiler.statsd_client ) {
req.profiler.start('windshaft-cartodb.get_template_list');
}
ws.doCORS(res); ws.doCORS(res);
var that = this; var that = this;
var response = {}; var response = {};