From: Jérôme Benoit Date: Sun, 9 Jul 2023 20:29:26 +0000 (+0200) Subject: refactor: cleanup task usage method namespace X-Git-Tag: v2.6.13~9 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=ce1b31beefa0f80927316fc762e5186f823e03c7;p=poolifier.git refactor: cleanup task usage method namespace Signed-off-by: Jérôme Benoit --- diff --git a/src/pools/abstract-pool.ts b/src/pools/abstract-pool.ts index a7f1579f..615cf296 100644 --- a/src/pools/abstract-pool.ts +++ b/src/pools/abstract-pool.ts @@ -672,9 +672,9 @@ export abstract class AbstractPool< const workerUsage = this.workerNodes[workerNodeKey].usage ++workerUsage.tasks.executing this.updateWaitTimeWorkerUsage(workerUsage, task) - const tasksWorkerUsage = this.workerNodes[ - workerNodeKey - ].getTasksWorkerUsage(task.name as string) as WorkerUsage + const tasksWorkerUsage = this.workerNodes[workerNodeKey].getTaskWorkerUsage( + task.name as string + ) as WorkerUsage ++tasksWorkerUsage.tasks.executing this.updateWaitTimeWorkerUsage(tasksWorkerUsage, task) } @@ -695,9 +695,9 @@ export abstract class AbstractPool< this.updateTaskStatisticsWorkerUsage(workerUsage, message) this.updateRunTimeWorkerUsage(workerUsage, message) this.updateEluWorkerUsage(workerUsage, message) - const tasksWorkerUsage = this.workerNodes[ - workerNodeKey - ].getTasksWorkerUsage(message.name as string) as WorkerUsage + const tasksWorkerUsage = this.workerNodes[workerNodeKey].getTaskWorkerUsage( + message.name as string + ) as WorkerUsage this.updateTaskStatisticsWorkerUsage(tasksWorkerUsage, message) this.updateRunTimeWorkerUsage(tasksWorkerUsage, message) this.updateEluWorkerUsage(tasksWorkerUsage, message) diff --git a/src/pools/worker-node.ts b/src/pools/worker-node.ts index 240f3045..a5cbbbfb 100644 --- a/src/pools/worker-node.ts +++ b/src/pools/worker-node.ts @@ -74,7 +74,7 @@ implements IWorkerNode { } /** @inheritdoc */ - public getTasksWorkerUsage (name: string): WorkerUsage | undefined { + public getTaskWorkerUsage (name: string): WorkerUsage | undefined { if (!this.tasksUsage.has(name)) { this.tasksUsage.set(name, this.initTaskWorkerUsage(name)) } diff --git a/src/pools/worker.ts b/src/pools/worker.ts index 41659adb..7c4a50c8 100644 --- a/src/pools/worker.ts +++ b/src/pools/worker.ts @@ -266,7 +266,7 @@ export interface IWorkerNode { */ readonly resetUsage: () => void /** - * Worker node get tasks usage statistics. + * Worker node get task usage statistics. */ - readonly getTasksWorkerUsage: (name: string) => WorkerUsage | undefined + readonly getTaskWorkerUsage: (name: string) => WorkerUsage | undefined }