Profiler don't log times if there is no one task done at least
This commit is contained in:
parent
22086ba914
commit
6cddec562a
@ -16,9 +16,10 @@ module.exports = function profiler (options) {
|
|||||||
profile: enabled
|
profile: enabled
|
||||||
});
|
});
|
||||||
|
|
||||||
req.profiler.start([prefix, 'response'].join('.'));
|
req.profiler.start(prefix);
|
||||||
|
|
||||||
res.on('finish', () => {
|
res.on('finish', () => {
|
||||||
|
req.profiler.done('response');
|
||||||
req.profiler.end();
|
req.profiler.end();
|
||||||
logger.info({ stats: req.profiler.toJSON() });
|
logger.info({ stats: req.profiler.toJSON() });
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user