Add request duration in milliseconds

This commit is contained in:
Daniel García Aubert 2020-07-23 11:37:00 +02:00
parent b7ecea3201
commit df604adc2a

View File

@ -19,7 +19,7 @@ module.exports = function profiler ({ statsClient, logOnEvent = 'finish' }) {
req.profiler.add({ response: new Date() - start }); req.profiler.add({ response: new Date() - start });
req.profiler.end(); req.profiler.end();
const stats = req.profiler.toJSON(); const stats = req.profiler.toJSON();
logger.info({ stats, duration: stats.response / 1000 }, 'Request profiling stats'); logger.info({ stats, duration: stats.response / 1000, duration_ms: stats.response }, 'Request profiling stats');
try { try {
req.profiler.sendStats(); req.profiler.sendStats();