Add more timing in the profile, add useProfiler config variable
Default to useProfiler:true in staging and development
This commit is contained in:
@@ -77,4 +77,4 @@ var RedisPool = function(opts){
|
||||
return me;
|
||||
};
|
||||
|
||||
module.exports = RedisPool;
|
||||
module.exports = RedisPool;
|
||||
|
||||
@@ -37,7 +37,8 @@ module.exports = function(){
|
||||
varnish_host: global.environment.varnish.host,
|
||||
varnish_port: global.environment.varnish.port,
|
||||
cache_enabled: global.environment.cache_enabled,
|
||||
log_format: global.environment.log_format
|
||||
log_format: global.environment.log_format,
|
||||
useProfiler: global.environment.useProfiler
|
||||
};
|
||||
|
||||
// Be nice and warn if configured mapnik version
|
||||
@@ -313,6 +314,7 @@ module.exports = function(){
|
||||
LZMA.decompress(
|
||||
lzma,
|
||||
function(result) {
|
||||
if (req.profiler) req.profiler.done('LZMA decompress');
|
||||
try {
|
||||
delete req.query.lzma
|
||||
_.extend(req.query, JSON.parse(result))
|
||||
@@ -357,11 +359,14 @@ module.exports = function(){
|
||||
|
||||
var that = this;
|
||||
|
||||
if (req.profiler) req.profiler.done('req2params.setup');
|
||||
|
||||
Step(
|
||||
function getPrivacy(){
|
||||
cartoData.authorize(req, this);
|
||||
},
|
||||
function gatekeep(err, data){
|
||||
if (req.profiler) req.profiler.done('cartoData.authorize');
|
||||
if(err) throw err;
|
||||
if(data === "0") throw new Error("Sorry, you are unauthorized (permission denied)");
|
||||
return data;
|
||||
@@ -372,18 +377,21 @@ module.exports = function(){
|
||||
cartoData.getDatabase(req, this);
|
||||
},
|
||||
function getGeometryType(err, data){
|
||||
if (req.profiler) req.profiler.done('cartoData.getDatabase');
|
||||
if (err) throw err;
|
||||
_.extend(req.params, {dbname:data});
|
||||
|
||||
cartoData.getGeometryType(req, this);
|
||||
},
|
||||
function finishSetup(err, data){
|
||||
if (req.profiler) req.profiler.done('cartoData.getGeometryType');
|
||||
if ( err ) { callback(err, req); return; }
|
||||
|
||||
if (!_.isNull(data))
|
||||
_.extend(req.params, {geom_type: data});
|
||||
|
||||
that.addCacheChannel(req, function(err) {
|
||||
if (req.profiler) req.profiler.done('addCacheChannel');
|
||||
callback(err, req);
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user