2 import { resolve } from 'path'
3 import WorkerNodes from '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 resolve('./workers/worker-nodes/function-to-bench-worker'),
18 taskTimeout: 60000 // this is the same as poolifier default
22 async function run () {
24 for (let i = 0; i < iterations; i++) {
25 promises.push(workerNodes.call.functionToBench(data))
27 await Promise.all(promises)
28 // eslint-disable-next-line n/no-process-exit