refactor: remove unneeded private getter
authorJérôme Benoit <jerome.benoit@sap.com>
Tue, 4 Jul 2023 15:08:57 +0000 (17:08 +0200)
committerJérôme Benoit <jerome.benoit@sap.com>
Tue, 4 Jul 2023 15:08:57 +0000 (17:08 +0200)
Signed-off-by: Jérôme Benoit <jerome.benoit@sap.com>
src/pools/abstract-pool.ts

index 796cff1d56c6f85e87f48609c938eaa84535edb7..283b04d682b4a656b6a430a78714a9ae52582e72 100644 (file)
@@ -300,22 +300,14 @@ export abstract class AbstractPool<
     }
   }
 
-  /**
-   * 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 poolRunTimeCapacity =
+      (performance.now() - this.startTimestamp) * this.maxSize
     const totalTasksRunTime = this.workerNodes.reduce(
       (accumulator, workerNode) =>
         accumulator + workerNode.usage.runTime.aggregate,