perf: add measurement coverage to benchmark
[poolifier.git] / benchmarks / benchmarks-utils.mjs
index 48d5e41b1f0138a589fe4dbee31a762ac92db845..48c8fc3e7cb7dacd019a4ca3ac8fa28749c61db5 100644 (file)
@@ -1,12 +1,14 @@
-import crypto from 'crypto'
-import fs from 'fs'
+import crypto from 'node:crypto'
+import fs from 'node:fs'
 import {
   DynamicClusterPool,
   DynamicThreadPool,
   FixedClusterPool,
-  FixedThreadPool
+  FixedThreadPool,
+  PoolTypes,
+  WorkerTypes
 } from '../lib/index.mjs'
-import { PoolTypes, WorkerFunctions, WorkerTypes } from './benchmarks-types.mjs'
+import { WorkerFunctions } from './benchmarks-types.mjs'
 
 export const runTest = async (pool, { taskExecutions, workerData }) => {
   return new Promise((resolve, reject) => {
@@ -51,6 +53,7 @@ const jsonIntegerSerialization = n => {
     }
     JSON.stringify(o)
   }
+  return { ok: 1 }
 }
 
 /**
@@ -94,6 +97,7 @@ const readWriteFiles = (
     fs.readFileSync(filePath, 'utf8')
   }
   fs.rmSync(baseDirectory, { recursive: true })
+  return { ok: 1 }
 }
 
 export const executeWorkerFunction = data => {