From be202c2c43686b8d46d7061622e17b6c173c9e33 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=B4me=20Benoit?= Date: Sun, 19 May 2024 23:16:43 +0200 Subject: [PATCH] refactor: add ELU utilization to pool info MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Trends on a ratio is not really meaningful but can help debugging Signed-off-by: Jérôme Benoit --- src/pools/abstract-pool.ts | 16 ++++++++++++++++ src/pools/pool.ts | 4 ++++ 2 files changed, 20 insertions(+) diff --git a/src/pools/abstract-pool.ts b/src/pools/abstract-pool.ts index 12ad6995..649d5f0d 100644 --- a/src/pools/abstract-pool.ts +++ b/src/pools/abstract-pool.ts @@ -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 + ) + ) + ) } } }) diff --git a/src/pools/pool.ts b/src/pools/pool.ts index a3552e48..a025f3ce 100644 --- a/src/pools/pool.ts +++ b/src/pools/pool.ts @@ -126,6 +126,10 @@ export interface PoolInfo { readonly average?: number readonly median?: number } + utilization: { + readonly average?: number + readonly median?: number + } } } -- 2.34.1