+ const workerNodeKey = this.getWorkerNodeKey(worker)
+ this.setWorkerNodeTasksUsage(
+ this.workerNodes[workerNodeKey],
+ this.getWorkerUsage(workerNodeKey)
+ )
+ return this.workerNodes.length
+ }
+
+ /**
+ * Gets the worker id.
+ *
+ * @param worker - The worker.
+ * @returns The worker id.
+ */
+ private getWorkerId (worker: Worker): number | undefined {
+ if (this.worker === WorkerTypes.thread) {
+ return worker.threadId
+ } else if (this.worker === WorkerTypes.cluster) {
+ return worker.id
+ }