From a0a800e37eaeb83260eb9b1970b3b1ec0739ace2 Mon Sep 17 00:00:00 2001 From: sunyuliang Date: Fri, 13 Sep 2024 11:58:40 +0800 Subject: [PATCH] feat(kcmas): add cpu usage ratio for pod and node custom metrics --- pkg/metric/node/node.go | 3 ++- pkg/metric/pod/pod.go | 7 ++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/pkg/metric/node/node.go b/pkg/metric/node/node.go index caca859..437f3c1 100644 --- a/pkg/metric/node/node.go +++ b/pkg/metric/node/node.go @@ -20,7 +20,8 @@ limitations under the License. package node const ( - CustomMetricNodeCPULoad1Min = "node_cpu_load_system_1min" + CustomMetricNodeCPUUsageRatio = "node_cpu_usage_ratio" + CustomMetricNodeCPULoad1Min = "node_cpu_load_system_1min" ) // real-time memory related metric diff --git a/pkg/metric/pod/pod.go b/pkg/metric/pod/pod.go index 2d27e58..f11f3a8 100644 --- a/pkg/metric/pod/pod.go +++ b/pkg/metric/pod/pod.go @@ -21,9 +21,10 @@ package pod // real-time cpu related metric const ( - CustomMetricPodCPULoad1Min = "pod_cpu_load_1min" - CustomMetricPodCPUUsage = "pod_cpu_usage" - CustomMetricPodCPUCPI = "pod_cpu_cpi" + CustomMetricPodCPULoad1Min = "pod_cpu_load_1min" + CustomMetricPodCPUUsage = "pod_cpu_usage" + CustomMetricPodCPUUsageRatio = "pod_cpu_usage_ratio" + CustomMetricPodCPUCPI = "pod_cpu_cpi" ) const (