Browse Source

Fix ClusterDisks to sum data from results with the same name

Niko Kovacevic 6 years ago
parent
commit
a11d733720
1 changed files with 2 additions and 2 deletions
  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,
 				Name:    name,
 			}
 			}
 		}
 		}
-		diskMap[key].Cost = cost
+		diskMap[key].Cost += cost
 	}
 	}
 
 
 	for _, result := range resPVSize {
 	for _, result := range resPVSize {
@@ -227,7 +227,7 @@ func ClusterDisks(client prometheus.Client, provider cloud.Provider, duration, o
 				Local:   true,
 				Local:   true,
 			}
 			}
 		}
 		}
-		diskMap[key].Cost = cost
+		diskMap[key].Cost += cost
 	}
 	}
 
 
 	for _, result := range resLocalStorageBytes {
 	for _, result := range resLocalStorageBytes {