MCPcopy Index your code
hub / github.com/nodejs/node / workerOnMetricsMsg

Function workerOnMetricsMsg

test/sequential/test-worker-eventlooputil.js:28–43  ·  view source on GitHub ↗
(msg)

Source from the content-addressed store, hash-verified

26}
27
28function workerOnMetricsMsg(msg) {
29 if (msg.cmd === 'close') {
30 return this.close();
31 }
32
33 if (msg.cmd === 'elu') {
34 return this.postMessage(eventLoopUtilization());
35 }
36
37 if (msg.cmd === 'spin') {
38 const elu = eventLoopUtilization();
39 const t = performance.now();
40 while (performance.now() - t < msg.dur);
41 return this.postMessage(eventLoopUtilization(elu));
42 }
43}
44
45let worker;
46let metricsCh;

Callers

nothing calls this directly

Calls 4

nowMethod · 0.80
closeMethod · 0.65
eventLoopUtilizationFunction · 0.50
postMessageMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…