Signed-off-by: Jérôme Benoit <jerome.benoit@sap.com>
implements IWorkerChoiceStrategy {
/** @inheritDoc */
public readonly taskStatisticsRequirements: TaskStatisticsRequirements = {
- runTime: false,
- avgRunTime: false,
- medRunTime: false,
- waitTime: false,
- avgWaitTime: false,
- medWaitTime: false,
+ runTime: {
+ aggregate: false,
+ average: false,
+ median: false
+ },
+ waitTime: {
+ aggregate: false,
+ average: false,
+ median: false
+ },
elu: true
}
opts: WorkerChoiceStrategyOptions = DEFAULT_WORKER_CHOICE_STRATEGY_OPTIONS
) {
super(pool, opts)
- this.setTaskStatistics(this.opts)
+ this.setTaskStatisticsRequirements(this.opts)
}
/** @inheritDoc */
expect(
pool.workerChoiceStrategyContext.getTaskStatisticsRequirements()
).toStrictEqual({
- runTime: false,
- avgRunTime: false,
- medRunTime: false,
- waitTime: false,
- avgWaitTime: false,
- medWaitTime: false,
+ runTime: {
+ aggregate: false,
+ average: false,
+ median: false
+ },
+ waitTime: {
+ aggregate: false,
+ average: false,
+ median: false
+ },
elu: true
})
await pool.destroy()
expect(
pool.workerChoiceStrategyContext.getTaskStatisticsRequirements()
).toStrictEqual({
- runTime: false,
- avgRunTime: false,
- medRunTime: false,
- waitTime: false,
- avgWaitTime: false,
- medWaitTime: false,
+ runTime: {
+ aggregate: false,
+ average: false,
+ median: false
+ },
+ waitTime: {
+ aggregate: false,
+ average: false,
+ median: false
+ },
elu: true
})
// We need to clean up the resources after our test
failed: 0
},
runTime: {
- aggregation: 0,
+ aggregate: 0,
average: 0,
median: 0,
history: expect.any(CircularArray)
},
waitTime: {
- aggregation: 0,
+ aggregate: 0,
average: 0,
median: 0,
history: expect.any(CircularArray)