* @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
}
/**
?.worker
}
+ /**
+ * Checks if the worker id sent in the received message from a worker is valid.
+ *
+ * @param message - The received message.
+ * @throws {@link https://nodejs.org/api/errors.html#class-error} If the worker id is invalid.
+ */
private checkMessageWorkerId (message: MessageValue<Response>): void {
if (
message.workerId != null &&