diff --git a/pkg/helmvm/helmvm_node.go b/pkg/helmvm/helmvm_node.go index cf576b8aa2..51a6cd1ef3 100644 --- a/pkg/helmvm/helmvm_node.go +++ b/pkg/helmvm/helmvm_node.go @@ -109,14 +109,14 @@ func nodeMetrics(ctx context.Context, client kubernetes.Interface, metricsClient podTotalCPU := 0.0 for _, container := range podMetrics.Containers { if container.Usage.Memory() != nil { - podTotalMemory += float64(container.Usage.Memory().Value()) / math.Pow(2, 30) + podTotalMemory += float64(container.Usage.Memory().Value()) / math.Pow(2, 20) } if container.Usage.Cpu() != nil { - podTotalCPU += container.Usage.Cpu().AsApproximateFloat64() + podTotalCPU += container.Usage.Cpu().AsApproximateFloat64() * 1000 } } - newInfo.Memory = podTotalMemory - newInfo.CPU = podTotalCPU + newInfo.Memory = fmt.Sprintf("%.1f MB", podTotalMemory) + newInfo.CPU = fmt.Sprintf("%.1f m", podTotalCPU) } podInfo = append(podInfo, newInfo) diff --git a/pkg/helmvm/types/types.go b/pkg/helmvm/types/types.go index b94f254dc0..f177df2b37 100644 --- a/pkg/helmvm/types/types.go +++ b/pkg/helmvm/types/types.go @@ -37,9 +37,9 @@ type NodeConditions struct { } type PodInfo struct { - Name string `json:"name"` - Status string `json:"status"` - Namespace string `json:"namespace"` - CPU float64 `json:"cpu"` - Memory float64 `json:"memory"` + Name string `json:"name"` + Status string `json:"status"` + Namespace string `json:"namespace"` + CPU string `json:"cpu"` + Memory string `json:"memory"` }