X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=benchmarks%2Fbenchmarks-utils.mjs;h=762966cf2437974977ec2e70012488a4e541c8ee;hb=4e1212db1d198963828820471bde6902277d0388;hp=0aeca085d9115959c46ee719f0d1c20740057def;hpb=479ba9f6225633cd90167c26aa0fe0e79401b989;p=poolifier.git diff --git a/benchmarks/benchmarks-utils.mjs b/benchmarks/benchmarks-utils.mjs index 0aeca085..762966cf 100644 --- a/benchmarks/benchmarks-utils.mjs +++ b/benchmarks/benchmarks-utils.mjs @@ -78,6 +78,23 @@ 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' +}) + export const executeAsyncFn = async fn => { try { await fn()