docs: add weighted round robin documentation
[poolifier.git] / src / pools / selection-strategies / weighted-round-robin-worker-choice-strategy.ts
index 75e278bc407d704069e946be11a899cdfadaf8a7..1ce6041920cfa634071093561eabc32e405272d2 100644 (file)
@@ -25,13 +25,21 @@ export class WeightedRoundRobinWorkerChoiceStrategy<
   implements IWorkerChoiceStrategy {
   /** @inheritDoc */
   public readonly taskStatisticsRequirements: TaskStatisticsRequirements = {
-    runTime: true,
-    avgRunTime: true,
-    medRunTime: false,
-    waitTime: false,
-    avgWaitTime: false,
-    medWaitTime: false,
-    elu: false
+    runTime: {
+      aggregate: true,
+      average: true,
+      median: false
+    },
+    waitTime: {
+      aggregate: false,
+      average: false,
+      median: false
+    },
+    elu: {
+      aggregate: false,
+      average: false,
+      median: false
+    }
   }
 
   /**
@@ -53,7 +61,7 @@ export class WeightedRoundRobinWorkerChoiceStrategy<
     opts: WorkerChoiceStrategyOptions = DEFAULT_WORKER_CHOICE_STRATEGY_OPTIONS
   ) {
     super(pool, opts)
-    this.setTaskStatistics(this.opts)
+    this.setTaskStatisticsRequirements(this.opts)
     this.defaultWorkerWeight = this.computeDefaultWorkerWeight()
   }