From: Jérôme Benoit Date: Mon, 10 Jul 2023 09:02:30 +0000 (+0200) Subject: refactor: cleanup variables namespace X-Git-Tag: v2.6.15~18 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=8e5ca0401467b0a5c40b20a40ef08db6c05b9561;p=poolifier.git refactor: cleanup variables namespace Signed-off-by: Jérôme Benoit --- 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)