diff --git a/lib/cartodb/server_options.js b/lib/cartodb/server_options.js index 6ff68e82..da4d5318 100644 --- a/lib/cartodb/server_options.js +++ b/lib/cartodb/server_options.js @@ -266,6 +266,7 @@ module.exports = function(){ // take place before proceeding. Error will be logged // asyncronously cartoData.incMapviewCount(username, mapconfig.stat_tag, function(err) { + if (req.profiler) req.profiler.done('incMapviewCount'); if ( err ) console.log("ERROR: failed to increment mapview count for user '" + username + "': " + err); done(); }); @@ -283,12 +284,14 @@ module.exports = function(){ var cacheKey = dbName + ':' + token; me.affectedTables(usr, key, sql, function(err, tableNames) { + if (req.profiler) req.profiler.done('affectedTables'); if ( err ) { done(err); return; } var cacheChannel = me.buildCacheChannel(dbName,tableNames); me.channelCache[cacheKey] = cacheChannel; // store for caching // find last updated me.findLastUpdated(usr, key, tableNames, function(err, lastUpdated) { + if (req.profiler) req.profiler.done('findLastUpdated'); if ( err ) { done(err); return; } response.layergroupid = response.layergroupid + ':' + lastUpdated; // use epoch response.last_updated = new Date(lastUpdated).toISOString(); // TODO: use ISO format