From: Jérôme Benoit Date: Sat, 16 Sep 2023 20:30:23 +0000 (+0200) Subject: test: fix continuous benchmark pool implementation name X-Git-Tag: v2.6.45~12 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=a7825346645f0152334effb28bf0297c78fde2cc;p=poolifier.git test: fix continuous benchmark pool implementation name Signed-off-by: Jérôme Benoit --- diff --git a/benchmarks/benchmarks-utils.mjs b/benchmarks/benchmarks-utils.mjs index 98893f62..762966cf 100644 --- a/benchmarks/benchmarks-utils.mjs +++ b/benchmarks/benchmarks-utils.mjs @@ -78,6 +78,18 @@ export const runPoolifierTest = async ( }) } +export const getPoolImplementationName = pool => { + if (pool instanceof FixedThreadPool) { + return 'FixedThreadPool' + } else if (pool instanceof DynamicThreadPool) { + return 'DynamicThreadPool' + } else if (pool instanceof FixedClusterPool) { + return 'FixedClusterPool' + } else if (pool instanceof DynamicClusterPool) { + return 'DynamicClusterPool' + } +} + export const LIST_FORMATTER = new Intl.ListFormat('en-US', { style: 'long', type: 'conjunction' diff --git a/benchmarks/internal/bench.mjs b/benchmarks/internal/bench.mjs index c20b011f..1b71538d 100644 --- a/benchmarks/internal/bench.mjs +++ b/benchmarks/internal/bench.mjs @@ -10,6 +10,7 @@ import { TaskFunctions } from '../benchmarks-types.mjs' import { LIST_FORMATTER, buildPoolifierPool, + getPoolImplementationName, runPoolifierTest } from '../benchmarks-utils.mjs' @@ -32,7 +33,7 @@ for (const pool of [fixedThreadPool]) { for (const workerChoiceStrategy of Object.values(WorkerChoiceStrategies)) { for (const enableTasksQueue of [false, true]) { poolifierSuite.add( - `${pool.constructor.name}|${workerChoiceStrategy}|${ + `${getPoolImplementationName(pool)}|${workerChoiceStrategy}|${ enableTasksQueue ? 'with' : 'without' } tasks queue`, async () => {