refactor: display queues usage in pool info only if enabled
[poolifier.git] / benchmarks / benchmarks-utils.mjs
index 225143f1a1b4d1d483342ad19903e0f4affaec07..c88ada12fa61eda4c474b4142bbd81dbb59ae06d 100644 (file)
@@ -51,6 +51,7 @@ const jsonIntegerSerialization = n => {
     }
     JSON.stringify(o)
   }
+  return { ok: 1 }
 }
 
 /**
@@ -94,6 +95,7 @@ const readWriteFiles = (
     fs.readFileSync(filePath, 'utf8')
   }
   fs.rmSync(baseDirectory, { recursive: true })
+  return { ok: 1 }
 }
 
 export const executeWorkerFunction = data => {
@@ -133,15 +135,15 @@ export const buildPool = (workerType, poolType, poolSize, poolOptions) => {
       switch (workerType) {
         case WorkerTypes.thread:
           return new DynamicThreadPool(
-            poolSize / 2,
-            poolSize * 3,
+            Math.floor(poolSize / 2),
+            poolSize,
             './benchmarks/internal/thread-worker.mjs',
             poolOptions
           )
         case WorkerTypes.cluster:
           return new DynamicClusterPool(
-            poolSize / 2,
-            poolSize * 3,
+            Math.floor(poolSize / 2),
+            poolSize,
             './benchmarks/internal/cluster-worker.mjs',
             poolOptions
           )