Explorar el Código

Fix ClusterNodes to sum data from nodes with the same name

Niko Kovacevic hace 5 años
padre
commit
c40f42d9dd
Se han modificado 1 ficheros con 3 adiciones y 3 borrados
  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