poolSize,
{ taskExecutions, workerData }
) => {
+ const bmfResults = {}
try {
const bench = new Bench()
const pool = buildPoolifierPool(workerType, poolType, poolSize)
console.table(bench.table())
await pool.destroy()
- const bmfResults = {}
for (const task of tasks) {
- bmfResults[task.name] = {
- latency: {
- lower_value: task.result.latency.mean - task.result.latency.sd,
- upper_value: task.result.latency.mean + task.result.latency.sd,
- value: task.result.latency.mean,
- },
- throughput: {
- lower_value: task.result.throughput.mean - task.result.throughput.sd,
- upper_value: task.result.throughput.mean + task.result.throughput.sd,
- value: task.result.throughput.mean,
- },
+ if (
+ task.result?.state === 'completed' ||
+ task.result?.state === 'aborted-with-statistics'
+ ) {
+ bmfResults[task.name] = {
+ latency: {
+ lower_value: task.result.latency.mean - task.result.latency.sd,
+ upper_value: task.result.latency.mean + task.result.latency.sd,
+ value: task.result.latency.mean,
+ },
+ throughput: {
+ lower_value:
+ task.result.throughput.mean - task.result.throughput.sd,
+ upper_value:
+ task.result.throughput.mean + task.result.throughput.sd,
+ value: task.result.throughput.mean,
+ },
+ }
}
}
return bmfResults
} catch (error) {
console.error(error)
+ return bmfResults
}
}