From 5dfe1ae00416747f54be460bec847945181471f5 Mon Sep 17 00:00:00 2001 From: ioito Date: Fri, 9 Dec 2022 11:27:04 +0800 Subject: [PATCH] fix(cloudmon): storage metric --- pkg/apis/compute/storage.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/apis/compute/storage.go b/pkg/apis/compute/storage.go index ca92575d87..dd03a1dd87 100644 --- a/pkg/apis/compute/storage.go +++ b/pkg/apis/compute/storage.go @@ -165,7 +165,7 @@ func (self StorageDetails) GetMetricTags() map[string]string { func (self StorageDetails) GetMetricPairs() map[string]string { usageActive := "0" if self.Capacity > 0 { - usageActive = strconv.FormatFloat(float64(self.ActualCapacityUsed/self.Capacity*100.0), 'f', -1, 64) + usageActive = strconv.FormatFloat(float64(self.ActualCapacityUsed)/float64(self.Capacity)*100.0, 'f', -1, 64) } ret := map[string]string{ "free": strconv.FormatFloat(float64(self.Capacity-self.ActualCapacityUsed), 'f', 2, 64),