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

Fix ClusterNodes to sum data from nodes with the same name

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

+ 3 - 3
pkg/costmodel/cluster.go

@@ -343,7 +343,7 @@ func ClusterNodes(cp cloud.Provider, client prometheus.Client, duration, offset
 				ProviderID: providerID,
 			}
 		}
-		nodeMap[key].CPUCost = cpuCost
+		nodeMap[key].CPUCost += cpuCost
 		nodeMap[key].NodeType = nodeType
 	}
 
@@ -397,7 +397,7 @@ func ClusterNodes(cp cloud.Provider, client prometheus.Client, duration, offset
 				ProviderID: providerID,
 			}
 		}
-		nodeMap[key].RAMCost = ramCost
+		nodeMap[key].RAMCost += ramCost
 		nodeMap[key].NodeType = nodeType
 	}
 
@@ -451,7 +451,7 @@ func ClusterNodes(cp cloud.Provider, client prometheus.Client, duration, offset
 				ProviderID: providerID,
 			}
 		}
-		nodeMap[key].GPUCost = gpuCost
+		nodeMap[key].GPUCost += gpuCost
 	}
 
 	// Determine preemptibility with node labels