- `WorkerChoiceStrategies.ROUND_ROBIN`: Submit tasks to worker in a round robin fashion
- `WorkerChoiceStrategies.LEAST_USED`: Submit tasks to the worker with the minimum number of executing and queued tasks
- - `WorkerChoiceStrategies.LEAST_BUSY`: Submit tasks to the worker with the minimum tasks total execution and wait time
+ - `WorkerChoiceStrategies.LEAST_BUSY`: Submit tasks to the worker with the minimum tasks execution time
- `WorkerChoiceStrategies.LEAST_ELU`: Submit tasks to the worker with the minimum event loop utilization (ELU)
- `WorkerChoiceStrategies.WEIGHTED_ROUND_ROBIN`: Submit tasks to worker by using a [weighted round robin scheduling algorithm](./worker-choice-strategies.md#weighted-round-robin) based on tasks execution time
- `WorkerChoiceStrategies.INTERLEAVED_WEIGHTED_ROUND_ROBIN`: Submit tasks to worker by using an [interleaved weighted round robin scheduling algorithm](./worker-choice-strategies.md#interleaved-weighted-round-robin-experimental) based on tasks execution time (experimental)
fixedPool,
[wwrWorkerChoiceStrategy],
{
- runTime: { median: true }
+ runTime: { median: true },
+ waitTime: { median: true }
}
)
expect(
workerChoiceStrategiesContext.getTaskStatisticsRequirements().runTime
.median
).toBe(true)
+ expect(
+ workerChoiceStrategiesContext.getTaskStatisticsRequirements().waitTime
+ .average
+ ).toBe(false)
+ expect(
+ workerChoiceStrategiesContext.getTaskStatisticsRequirements().waitTime
+ .median
+ ).toBe(true)
workerChoiceStrategiesContext = new WorkerChoiceStrategiesContext(
dynamicPool,
[wwrWorkerChoiceStrategy],
{
- runTime: { median: true }
+ runTime: { median: true },
+ waitTime: { median: true }
}
)
expect(
workerChoiceStrategiesContext.getTaskStatisticsRequirements().runTime
.median
).toBe(true)
+ expect(
+ workerChoiceStrategiesContext.getTaskStatisticsRequirements().waitTime
+ .average
+ ).toBe(false)
+ expect(
+ workerChoiceStrategiesContext.getTaskStatisticsRequirements().waitTime
+ .median
+ ).toBe(true)
const fsWorkerChoiceStrategy = WorkerChoiceStrategies.FAIR_SHARE
workerChoiceStrategiesContext = new WorkerChoiceStrategiesContext(
fixedPool,
[fsWorkerChoiceStrategy],
{
- runTime: { median: true }
+ runTime: { median: true },
+ waitTime: { median: true }
}
)
expect(
workerChoiceStrategiesContext.getTaskStatisticsRequirements().runTime
.median
).toBe(true)
+ expect(
+ workerChoiceStrategiesContext.getTaskStatisticsRequirements().waitTime
+ .average
+ ).toBe(false)
+ expect(
+ workerChoiceStrategiesContext.getTaskStatisticsRequirements().waitTime
+ .median
+ ).toBe(true)
workerChoiceStrategiesContext = new WorkerChoiceStrategiesContext(
dynamicPool,
[fsWorkerChoiceStrategy],
{
- runTime: { median: true }
+ runTime: { median: true },
+ waitTime: { median: true }
}
)
expect(
workerChoiceStrategiesContext.getTaskStatisticsRequirements().runTime
.median
).toBe(true)
+ expect(
+ workerChoiceStrategiesContext.getTaskStatisticsRequirements().waitTime
+ .average
+ ).toBe(false)
+ expect(
+ workerChoiceStrategiesContext.getTaskStatisticsRequirements().waitTime
+ .median
+ ).toBe(true)
})
})