From 6cddec562a7fdc2a74d000b319f581d7e32a9b3f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Garc=C3=ADa=20Aubert?= Date: Fri, 19 Jun 2020 11:42:46 +0200 Subject: [PATCH] Profiler don't log times if there is no one task done at least --- lib/api/middlewares/profiler.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/api/middlewares/profiler.js b/lib/api/middlewares/profiler.js index 9d2b573b..f4af21d7 100644 --- a/lib/api/middlewares/profiler.js +++ b/lib/api/middlewares/profiler.js @@ -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() });