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

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.
*/
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);
Step(
function(){
@@ -118,6 +121,9 @@ var CartodbWindshaft = function(serverOptions) {
* Helper to allow access to metadata to be used in embedded maps.
*/
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);
Step(
function(){
@@ -139,6 +145,9 @@ var CartodbWindshaft = function(serverOptions) {
* TODO: Move?
*/
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);
Step(
function flushCache(){
@@ -273,6 +282,9 @@ var CartodbWindshaft = function(serverOptions) {
// Get a specific template
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);
var that = this;
var response = {};
@@ -330,7 +342,10 @@ var CartodbWindshaft = function(serverOptions) {
});
// 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);
var that = this;
var response = {};
@@ -381,6 +396,9 @@ var CartodbWindshaft = function(serverOptions) {
// Get a list of owned templates
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);
var that = this;
var response = {};