* @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) =>
accumulator + (workerNode.usage.waitTime?.aggregate ?? 0),
0
)
- return (totalTasksRunTime + totalTasksWaitTime) / poolRunTimeCapacity
+ return (totalTasksRunTime + totalTasksWaitTime) / poolTimeCapacity
}
/**
}
/**
- * Starts the worker alive check interval.
+ * Starts the worker aliveness check interval.
*/
private startCheckAlive (): void {
this.lastTaskTimestamp = performance.now()
}
/**
- * Stops the worker alive check interval.
+ * Stops the worker aliveness check interval.
*/
private stopCheckAlive (): void {
this.aliveInterval != null && clearInterval(this.aliveInterval)