(msg)
| 26 | } |
| 27 | |
| 28 | function 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 | |
| 45 | let worker; |
| 46 | let metricsCh; |
nothing calls this directly
no test coverage detected
searching dependent graphs…