From c8d461333b4fd8b2457c56338d011b102d2db0d9 Mon Sep 17 00:00:00 2001 From: jo-hnny Date: Mon, 12 Dec 2022 17:26:56 +0800 Subject: [PATCH] fix(console): fix gpu monitor chart (#2208) --- .../modules/cluster/models/MonitorPanel.tsx | 20 ++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/web/console/src/modules/cluster/models/MonitorPanel.tsx b/web/console/src/modules/cluster/models/MonitorPanel.tsx index 516e19bad..49cb1f103 100644 --- a/web/console/src/modules/cluster/models/MonitorPanel.tsx +++ b/web/console/src/modules/cluster/models/MonitorPanel.tsx @@ -171,17 +171,27 @@ const gpuMemFields = table => [ { expr: `mean(k8s_${table}_gpu_used)`, alias: t('GPU使用量'), - unit: t('卡') + unit: t('卡'), + valueTransform: value => { + if (value) return value / 100; + + return value; + } }, { expr: `mean(k8s_${table}_rate_gpu_used_node)`, - alias: t('GPU使用量(占节点)'), - unit: t('卡') + alias: t('GPU使用率(占节点)'), + unit: '%' }, { expr: `mean(k8s_${table}_rate_gpu_used_request)`, - alias: t('GPU使用量(占Request)'), - unit: t('卡') + alias: t('GPU使用率(占Request)'), + unit: '%', + valueTransform: value => { + if (value) return value * 100; + + return value; + } }, { expr: `mean(k8s_${table}_gpu_memory_used)`,