Merge pull request #15533 from ioito/automated-cherry-pick-of-#15532-upstream-release-3.10

Automated cherry pick of #15532: fix(cloudmon): storage metric
This commit is contained in:
Zexi Li
2022-12-09 11:42:13 +08:00
committed by GitHub
+1 -1
View File
@@ -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),