Signed-off-by: Jérôme Benoit <jerome.benoit@sap.com>
+### Fixed
+
+- Fix average statistics computation: ensure failed tasks are not accounted.
+
## [2.6.0] - 2023-06-09
### Added
## [2.6.0] - 2023-06-09
### Added
): void {
const workerUsage =
this.workerNodes[this.getWorkerNodeKey(worker)].workerUsage
): void {
const workerUsage =
this.workerNodes[this.getWorkerNodeKey(worker)].workerUsage
+ this.updateTaskStatisticsWorkerUsage(workerUsage, message)
+ this.updateRunTimeWorkerUsage(workerUsage, message)
+ this.updateEluWorkerUsage(workerUsage, message)
+ }
+
+ private updateTaskStatisticsWorkerUsage (
+ workerUsage: WorkerUsage,
+ message: MessageValue<Response>
+ ): void {
const workerTaskStatistics = workerUsage.tasks
--workerTaskStatistics.executing
++workerTaskStatistics.executed
if (message.taskError != null) {
++workerTaskStatistics.failed
}
const workerTaskStatistics = workerUsage.tasks
--workerTaskStatistics.executing
++workerTaskStatistics.executed
if (message.taskError != null) {
++workerTaskStatistics.failed
}
- this.updateRunTimeWorkerUsage(workerUsage, message)
- this.updateEluWorkerUsage(workerUsage, message)
}
private updateRunTimeWorkerUsage (
}
private updateRunTimeWorkerUsage (
workerUsage.tasks.executed !== 0
) {
workerUsage.runTime.average =
workerUsage.tasks.executed !== 0
) {
workerUsage.runTime.average =
- workerUsage.runTime.aggregate / workerUsage.tasks.executed
+ workerUsage.runTime.aggregate /
+ (workerUsage.tasks.executed - workerUsage.tasks.failed)
}
if (
this.workerChoiceStrategyContext.getTaskStatisticsRequirements().runTime
}
if (
this.workerChoiceStrategyContext.getTaskStatisticsRequirements().runTime
workerUsage.tasks.executed !== 0
) {
workerUsage.waitTime.average =
workerUsage.tasks.executed !== 0
) {
workerUsage.waitTime.average =
- workerUsage.waitTime.aggregate / workerUsage.tasks.executed
+ workerUsage.waitTime.aggregate /
+ (workerUsage.tasks.executed - workerUsage.tasks.failed)
}
if (
this.workerChoiceStrategyContext.getTaskStatisticsRequirements()
}
if (
this.workerChoiceStrategyContext.getTaskStatisticsRequirements()
.average &&
workerUsage.tasks.executed !== 0
) {
.average &&
workerUsage.tasks.executed !== 0
) {
+ const executedTasks =
+ workerUsage.tasks.executed - workerUsage.tasks.failed
workerUsage.elu.idle.average =
workerUsage.elu.idle.average =
- workerUsage.elu.idle.aggregate / workerUsage.tasks.executed
+ workerUsage.elu.idle.aggregate / executedTasks
workerUsage.elu.active.average =
workerUsage.elu.active.average =
- workerUsage.elu.active.aggregate / workerUsage.tasks.executed
+ workerUsage.elu.active.aggregate / executedTasks
}
if (
this.workerChoiceStrategyContext.getTaskStatisticsRequirements().elu
}
if (
this.workerChoiceStrategyContext.getTaskStatisticsRequirements().elu
### Fair share
Its goal is to distribute the load evenly across all workers. To achieve this, the strategy keeps track of the average task execution time for each worker and assigns the next task to the worker with the lowest task end prediction time: `task_end_prediction = max(current_time, task_end_prediction) + average_task_execution_time`.
### Fair share
Its goal is to distribute the load evenly across all workers. To achieve this, the strategy keeps track of the average task execution time for each worker and assigns the next task to the worker with the lowest task end prediction time: `task_end_prediction = max(current_time, task_end_prediction) + average_task_execution_time`.
-By default, the strategy uses the average task execution time for each worker but it can be configured to use the event loop utilization (ELU) active time instead.
+By default, the strategy uses the average task execution time for each worker but it can be configured to use the task event loop utilization (ELU) active time instead.