Просмотр исходного кода

Fix ClusterDisks to sum data from results with the same name

Niko Kovacevic 5 лет назад
Родитель
Сommit
a11d733720
1 измененных файлов с 2 добавлено и 2 удалено
  1. 2 2
      pkg/costmodel/cluster.go

+ 2 - 2
pkg/costmodel/cluster.go

@@ -176,7 +176,7 @@ func ClusterDisks(client prometheus.Client, provider cloud.Provider, duration, o
 				Name:    name,
 			}
 		}
-		diskMap[key].Cost = cost
+		diskMap[key].Cost += cost
 	}
 
 	for _, result := range resPVSize {
@@ -227,7 +227,7 @@ func ClusterDisks(client prometheus.Client, provider cloud.Provider, duration, o
 				Local:   true,
 			}
 		}
-		diskMap[key].Cost = cost
+		diskMap[key].Cost += cost
 	}
 
 	for _, result := range resLocalStorageBytes {