true
)
})
-
- it('Verify that worker choice strategy options enable median wait time pool statistics', () => {
- const wwrWorkerChoiceStrategy = WorkerChoiceStrategies.WEIGHTED_ROUND_ROBIN
- let workerChoiceStrategyContext = new WorkerChoiceStrategyContext(
- fixedPool,
- wwrWorkerChoiceStrategy,
- {
- medWaitTime: true
- }
- )
- expect(
- workerChoiceStrategyContext.getRequiredStatistics().avgWaitTime
- ).toBe(false)
- expect(
- workerChoiceStrategyContext.getRequiredStatistics().medWaitTime
- ).toBe(true)
- workerChoiceStrategyContext = new WorkerChoiceStrategyContext(
- dynamicPool,
- wwrWorkerChoiceStrategy,
- {
- medWaitTime: true
- }
- )
- expect(
- workerChoiceStrategyContext.getRequiredStatistics().avgWaitTime
- ).toBe(false)
- expect(
- workerChoiceStrategyContext.getRequiredStatistics().medWaitTime
- ).toBe(true)
- const fsWorkerChoiceStrategy = WorkerChoiceStrategies.FAIR_SHARE
- workerChoiceStrategyContext = new WorkerChoiceStrategyContext(
- fixedPool,
- fsWorkerChoiceStrategy,
- {
- medWaitTime: true
- }
- )
- expect(
- workerChoiceStrategyContext.getRequiredStatistics().avgWaitTime
- ).toBe(false)
- expect(
- workerChoiceStrategyContext.getRequiredStatistics().medWaitTime
- ).toBe(true)
- workerChoiceStrategyContext = new WorkerChoiceStrategyContext(
- dynamicPool,
- fsWorkerChoiceStrategy,
- {
- medWaitTime: true
- }
- )
- expect(
- workerChoiceStrategyContext.getRequiredStatistics().avgWaitTime
- ).toBe(false)
- expect(
- workerChoiceStrategyContext.getRequiredStatistics().medWaitTime
- ).toBe(true)
- })
})