build: update volta node.js version
[poolifier.git] / benchmarks / versus-external-pools / fixed-workerpool.js
index 5807f67cfd37bf44e008f0d4f0e0034bb4194ac9..cabdd9e794545c79e8a88ccc6e11eeb5ebd81ff7 100644 (file)
@@ -1,15 +1,19 @@
 // IMPORT LIBRARIES
 const workerpool = require('workerpool')
 // FINISH IMPORT LIBRARIES
-const size = process.env.POOL_SIZE
-const iterations = process.env.NUM_ITERATIONS
-const dataArray = ['MYBENCH', process.env['TASK_TYPE']]
+const size = parseInt(process.env.POOL_SIZE)
+const iterations = parseInt(process.env.NUM_ITERATIONS)
+const dataArray = [
+  'MYBENCH',
+  process.env.TASK_TYPE,
+  parseInt(process.env.TASK_SIZE)
+]
 
 const workerPool = workerpool.pool(
   './workers/workerpool/function-to-bench-worker.js',
   {
-    minWorkers: Number(size),
-    maxWorkers: Number(size),
+    minWorkers: size,
+    maxWorkers: size,
     workerType: 'thread'
   }
 )
@@ -20,6 +24,7 @@ async function run () {
     promises.push(workerPool.exec('functionToBench', dataArray))
   }
   await Promise.all(promises)
+  // eslint-disable-next-line n/no-process-exit
   process.exit()
 }