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

Function checkWorkerIdle

test/sequential/test-worker-eventlooputil.js:72–95  ·  view source on GitHub ↗
(wElu)

Source from the content-addressed store, hash-verified

70})();
71
72function checkWorkerIdle(wElu) {
73 const perfWorkerElu = workerELU();
74 const tmpMainElu = eventLoopUtilization(mainElu);
75
76 assert.ok(idleActive(wElu) > 0, `${idleActive(wElu)} <= 0`);
77 assert.ok(idleActive(workerELU(wElu)) > 0,
78 `${idleActive(workerELU(wElu))} <= 0`);
79 assert.ok(idleActive(perfWorkerElu) > idleActive(wElu),
80 `${idleActive(perfWorkerElu)} <= ${idleActive(wElu)}`);
81 assert.ok(idleActive(tmpMainElu) > idleActive(perfWorkerElu),
82 `${idleActive(tmpMainElu)} <= ${idleActive(perfWorkerElu)}`);
83
84 wElu = workerELU();
85 setTimeout(mustCall(() => {
86 wElu = workerELU(wElu);
87 // Some clocks fire early. Removing a few milliseconds to cover that.
88 assert.ok(idleActive(wElu) >= 45, `${idleActive(wElu)} < 45`);
89 // Cutting the idle time in half since it's possible that the call took a
90 // lot of resources to process?
91 assert.ok(wElu.idle >= 25, `${wElu.idle} < 25`);
92
93 checkWorkerActive();
94 }), 50);
95}
96
97function checkWorkerActive() {
98 const w = workerELU();

Callers

nothing calls this directly

Calls 6

idleActiveFunction · 0.85
checkWorkerActiveFunction · 0.85
eventLoopUtilizationFunction · 0.50
setTimeoutFunction · 0.50
mustCallFunction · 0.50
okMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…