refactor: add ELU utilization to pool info
authorJérôme Benoit <jerome.benoit@piment-noir.org>
Sun, 19 May 2024 21:16:43 +0000 (23:16 +0200)
committerJérôme Benoit <jerome.benoit@piment-noir.org>
Sun, 19 May 2024 21:16:43 +0000 (23:16 +0200)
Trends on a ratio is not really meaningful but can help debugging

Signed-off-by: Jérôme Benoit <jerome.benoit@piment-noir.org>
src/pools/abstract-pool.ts
src/pools/pool.ts

index 12ad699511efdc9e812d893e66c6233091fc1c9d..649d5f0d0d5e268b26f3285f3dd27aaae52a1c2d 100644 (file)
@@ -538,6 +538,22 @@ export abstract class AbstractPool<
                 )
               )
             })
+          },
+          utilization: {
+            average: round(
+              average(
+                this.workerNodes.map(
+                  workerNode => workerNode.usage.elu.utilization ?? 0
+                )
+              )
+            ),
+            median: round(
+              median(
+                this.workerNodes.map(
+                  workerNode => workerNode.usage.elu.utilization ?? 0
+                )
+              )
+            )
           }
         }
       })
index a3552e486ed348fe8c0a35041a9ede5e3b028e92..a025f3ced9568eb872957b98d060ce66ef27ad10 100644 (file)
@@ -126,6 +126,10 @@ export interface PoolInfo {
       readonly average?: number
       readonly median?: number
     }
+    utilization: {
+      readonly average?: number
+      readonly median?: number
+    }
   }
 }