Profiler don't log times if there is no one task done at least

remotes/origin/dgaubert/ch78384/maps-api-replace-log4js-logger-by-pino
Daniel García Aubert 4 years ago
parent 22086ba914
commit 6cddec562a

@ -16,9 +16,10 @@ module.exports = function profiler (options) {
profile: enabled
});
req.profiler.start([prefix, 'response'].join('.'));
req.profiler.start(prefix);
res.on('finish', () => {
req.profiler.done('response');
req.profiler.end();
logger.info({ stats: req.profiler.toJSON() });

Loading…
Cancel
Save