Browse Source

Add some simple (temporary) logging of placeholder timing

placeholder-lang-param-with-timing
Julian Simioni 6 years ago
parent
commit
c2c367cc14
No known key found for this signature in database
GPG Key ID: B9EEB0C6EE0910A1
  1. 9
      controller/placeholder.js

9
controller/placeholder.js

@ -228,8 +228,17 @@ function setup(placeholderService, do_geometric_filters_apply, should_execute) {
return next(); return next();
} }
const initialTime = debugLog.beginTimer(req); const initialTime = debugLog.beginTimer(req);
const start = Date.now();
placeholderService(req, (err, results) => { placeholderService(req, (err, results) => {
const requestTime = Date.now() - start;
logger.info({
time: requestTime,
query: req.query,
service: 'placeholder',
});
if (err) { if (err) {
// push err.message or err onto req.errors // push err.message or err onto req.errors
req.errors.push( _.get(err, 'message', err)); req.errors.push( _.get(err, 'message', err));

Loading…
Cancel
Save