From 8e5ca0401467b0a5c40b20a40ef08db6c05b9561 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=B4me=20Benoit?= Date: Mon, 10 Jul 2023 11:02:30 +0200 Subject: [PATCH] refactor: cleanup variables 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 | 4 ++-- src/worker/abstract-worker.ts | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/pools/abstract-pool.ts b/src/pools/abstract-pool.ts index 8beede87..cb5d4ce7 100644 --- a/src/pools/abstract-pool.ts +++ b/src/pools/abstract-pool.ts @@ -426,7 +426,7 @@ export abstract class AbstractPool< * @returns The pool utilization. */ private get utilization (): number { - const poolRunTimeCapacity = + const poolTimeCapacity = (performance.now() - this.startTimestamp) * this.maxSize const totalTasksRunTime = this.workerNodes.reduce( (accumulator, workerNode) => @@ -438,7 +438,7 @@ export abstract class AbstractPool< accumulator + (workerNode.usage.waitTime?.aggregate ?? 0), 0 ) - return (totalTasksRunTime + totalTasksWaitTime) / poolRunTimeCapacity + return (totalTasksRunTime + totalTasksWaitTime) / poolTimeCapacity } /** diff --git a/src/worker/abstract-worker.ts b/src/worker/abstract-worker.ts index bfdff391..93a36bad 100644 --- a/src/worker/abstract-worker.ts +++ b/src/worker/abstract-worker.ts @@ -303,7 +303,7 @@ export abstract class AbstractWorker< } /** - * Starts the worker alive check interval. + * Starts the worker aliveness check interval. */ private startCheckAlive (): void { this.lastTaskTimestamp = performance.now() @@ -315,7 +315,7 @@ export abstract class AbstractWorker< } /** - * Stops the worker alive check interval. + * Stops the worker aliveness check interval. */ private stopCheckAlive (): void { this.aliveInterval != null && clearInterval(this.aliveInterval) -- 2.34.1