X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=benchmarks%2Finternal%2Fcluster%2Ffixed.js;h=388689a3be7e5bc8ba37e38e7b53cd1b902f0d22;hb=2d2e32c20d55c1b81771659fd81004bd7ca34b73;hp=fc4cc3ac8dc545ba4b8d530401b19ac396f1f02c;hpb=e843b9042b77e0e4e17c193820a3e05ffc92cffe;p=poolifier.git diff --git a/benchmarks/internal/cluster/fixed.js b/benchmarks/internal/cluster/fixed.js index fc4cc3ac..388689a3 100644 --- a/benchmarks/internal/cluster/fixed.js +++ b/benchmarks/internal/cluster/fixed.js @@ -18,6 +18,18 @@ const fixedPoolLessRecentlyUsed = new FixedClusterPool( { workerChoiceStrategy: WorkerChoiceStrategies.LESS_RECENTLY_USED } ) +const fixedPoolWeightedRoundRobin = new FixedClusterPool( + size, + './benchmarks/internal/cluster/worker.js', + { workerChoiceStrategy: WorkerChoiceStrategies.WEIGHTED_ROUND_ROBIN } +) + +const fixedPoolFairShare = new FixedClusterPool( + size, + './benchmarks/internal/cluster/worker.js', + { workerChoiceStrategy: WorkerChoiceStrategies.FAIR_SHARE } +) + async function fixedClusterTest ( { tasks, workerData } = { tasks: numberOfTasks, workerData: { proof: 'ok' } } ) { @@ -30,4 +42,21 @@ async function fixedClusterTestLessRecentlyUsed ( return runPoolifierTest(fixedPoolLessRecentlyUsed, { tasks, workerData }) } -module.exports = { fixedClusterTest, fixedClusterTestLessRecentlyUsed } +async function fixedClusterTestWeightedRoundRobin ( + { tasks, workerData } = { tasks: numberOfTasks, workerData: { proof: 'ok' } } +) { + return runPoolifierTest(fixedPoolWeightedRoundRobin, { tasks, workerData }) +} + +async function fixedClusterTestFairShare ( + { tasks, workerData } = { tasks: numberOfTasks, workerData: { proof: 'ok' } } +) { + return runPoolifierTest(fixedPoolFairShare, { tasks, workerData }) +} + +module.exports = { + fixedClusterTest, + fixedClusterTestLessRecentlyUsed, + fixedClusterTestWeightedRoundRobin, + fixedClusterTestFairShare +}