docs: refine benchmark README.md
[poolifier.git] / benchmarks / benchmarks-utils.mjs
index 0aeca085d9115959c46ee719f0d1c20740057def..762966cf2437974977ec2e70012488a4e541c8ee 100644 (file)
@@ -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()