d5b01353d2eb0a9c54272e9619080bec92d7bebb
3 const WorkerNodes
= require('worker-nodes')
4 // FINISH IMPORT LIBRARIES
5 const size
= parseInt(process
.env
.POOL_SIZE
)
6 const iterations
= parseInt(process
.env
.NUM_ITERATIONS
)
9 taskType
: process
.env
.TASK_TYPE
,
10 taskSize
: parseInt(process
.env
.TASK_SIZE
)
13 const workerNodes
= new WorkerNodes(
14 require
.resolve('./workers/worker-nodes/function-to-bench-worker'),
18 taskTimeout
: 60000 // this is the same as poolifier default
22 async
function run () {
23 const promises
= new Set()
24 for (let i
= 0; i
< iterations
; i
++) {
25 promises
.add(workerNodes
.call
.functionToBench(data
))
27 await Promise
.all(promises
)
28 // eslint-disable-next-line n/no-process-exit
37 // eslint-disable-next-line n/no-process-exit