+ /**
+ * Gets the pool run time.
+ *
+ * @returns The pool run time in milliseconds.
+ */
+ private get runTime (): number {
+ return performance.now() - this.startTimestamp
+ }
+
+ /**
+ * Gets the approximate pool utilization.
+ *
+ * @returns The pool utilization.
+ */
+ private get utilization (): number {
+ const poolRunTimeCapacity = this.runTime * this.maxSize
+ const totalTasksRunTime = this.workerNodes.reduce(
+ (accumulator, workerNode) =>
+ accumulator + workerNode.usage.runTime.aggregate,
+ 0
+ )
+ const totalTasksWaitTime = this.workerNodes.reduce(
+ (accumulator, workerNode) =>
+ accumulator + workerNode.usage.waitTime.aggregate,
+ 0
+ )
+ return (totalTasksRunTime + totalTasksWaitTime) / poolRunTimeCapacity
+ }
+