0
votes

According to Node js documentation here, I am trying to measure the event loop lag of my application. Following this code in the documentation:

const { monitorEventLoopDelay } = require('perf_hooks');
const h = monitorEventLoopDelay({ resolution: 20 });
h.enable();
// ....
console.log(h.percentiles);

Output is:

Map {
0 => 1202176,
50 => 2260992,
75 => 2318336,
87.5 => 2334720,
93.75 => 2342912,
96.875 => 2347008,
98.4375 => 2351104,
99.21875 => 2377728,
99.609375 => 2670592,
99.8046875 => 3000320,
99.90234375 => 6770688,
99.951171875 => 6942720,
99.9755859375 => 27770880,
100 => 27770880

}

What is the magnitude used in the percentiles? Can I get it in milliseconds?

EDIT: Found the answer in documentation: The delays will be reported in nanoseconds.

So. we're done here then? - Wyck
Yes, i should have checked the documentation better before asking. - Rafael Páez Bastida