X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2Fpools%2Fselection-strategies%2Finterleaved-weighted-round-robin-worker-choice-strategy.ts;h=db439f0209c2ddf21cbe081f3d2b72138453545b;hb=28883f84b5381bb9af4c71e3bccd5297f6ab5fcf;hp=0f718e9817159bd6aedb5012e3246786d4696f50;hpb=ab3bb4a4fd6b09465fb97ec4f412e57448f94306;p=poolifier.git diff --git a/src/pools/selection-strategies/interleaved-weighted-round-robin-worker-choice-strategy.ts b/src/pools/selection-strategies/interleaved-weighted-round-robin-worker-choice-strategy.ts index 0f718e98..db439f02 100644 --- a/src/pools/selection-strategies/interleaved-weighted-round-robin-worker-choice-strategy.ts +++ b/src/pools/selection-strategies/interleaved-weighted-round-robin-worker-choice-strategy.ts @@ -1,12 +1,12 @@ -import type { IWorker } from '../worker' -import type { IPool } from '../pool' -import { DEFAULT_MEASUREMENT_STATISTICS_REQUIREMENTS } from '../../utils' -import { AbstractWorkerChoiceStrategy } from './abstract-worker-choice-strategy' +import type { IWorker } from '../worker.js' +import type { IPool } from '../pool.js' +import { DEFAULT_MEASUREMENT_STATISTICS_REQUIREMENTS } from '../../utils.js' +import { AbstractWorkerChoiceStrategy } from './abstract-worker-choice-strategy.js' import type { IWorkerChoiceStrategy, InternalWorkerChoiceStrategyOptions, TaskStatisticsRequirements -} from './selection-strategies-types' +} from './selection-strategies-types.js' /** * Selects the next worker with an interleaved weighted round robin scheduling algorithm. @@ -40,7 +40,7 @@ export class InterleavedWeightedRoundRobinWorkerChoiceStrategy< /** * Round weights. */ - private roundWeights!: number[] + private roundWeights: number[] /** * Worker node id. */ @@ -56,7 +56,8 @@ export class InterleavedWeightedRoundRobinWorkerChoiceStrategy< opts: InternalWorkerChoiceStrategyOptions ) { super(pool, opts) - this.setOptions(this.opts) + this.setTaskStatisticsRequirements(this.opts) + this.roundWeights = this.getRoundWeights() } /** @inheritDoc */