From ce1b31beefa0f80927316fc762e5186f823e03c7 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=B4me=20Benoit?= Date: Sun, 9 Jul 2023 22:29:26 +0200 Subject: [PATCH] refactor: cleanup task usage method namespace MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Jérôme Benoit --- src/pools/abstract-pool.ts | 12 ++++++------ src/pools/worker-node.ts | 2 +- src/pools/worker.ts | 4 ++-- 3 files changed, 9 insertions(+), 9 deletions(-) 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 } -- 2.34.1