X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2Fpools%2Fselection-strategies%2Fleast-elu-worker-choice-strategy.ts;h=35ab69d0ca38595c2f81be566a0b7352bf900e4e;hb=dc32abbbbd36504ce933a0403cc245899c25a828;hp=fbbd48e3c918568b3c493a8cff4e4044a67106bc;hpb=4a59691c9f48b3a6602510aeece809e2a0fe14c1;p=poolifier.git diff --git a/src/pools/selection-strategies/least-elu-worker-choice-strategy.ts b/src/pools/selection-strategies/least-elu-worker-choice-strategy.ts index fbbd48e3..35ab69d0 100644 --- a/src/pools/selection-strategies/least-elu-worker-choice-strategy.ts +++ b/src/pools/selection-strategies/least-elu-worker-choice-strategy.ts @@ -24,13 +24,21 @@ export class LeastEluWorkerChoiceStrategy< implements IWorkerChoiceStrategy { /** @inheritDoc */ public readonly taskStatisticsRequirements: TaskStatisticsRequirements = { - runTime: false, - avgRunTime: false, - medRunTime: false, - waitTime: false, - avgWaitTime: false, - medWaitTime: false, - elu: true + runTime: { + aggregate: false, + average: false, + median: false + }, + waitTime: { + aggregate: false, + average: false, + median: false + }, + elu: { + aggregate: true, + average: false, + median: false + } } /** @inheritDoc */ @@ -39,7 +47,7 @@ export class LeastEluWorkerChoiceStrategy< opts: WorkerChoiceStrategyOptions = DEFAULT_WORKER_CHOICE_STRATEGY_OPTIONS ) { super(pool, opts) - this.setTaskStatistics(this.opts) + this.setTaskStatisticsRequirements(this.opts) } /** @inheritDoc */ @@ -58,7 +66,7 @@ export class LeastEluWorkerChoiceStrategy< let leastEluWorkerNodeKey!: number for (const [workerNodeKey, workerNode] of this.pool.workerNodes.entries()) { const workerUsage = workerNode.workerUsage - const workerElu = workerUsage.elu?.utilization ?? 0 + const workerElu = workerUsage.elu?.active.aggregate ?? 0 if (workerElu === 0) { return workerNodeKey } else if (workerElu < minWorkerElu) {