Explorar el Código

discount should be applied to totalcost

AjayTripathy hace 6 años
padre
commit
2fdb6080cf
Se han modificado 1 ficheros con 1 adiciones y 1 borrados
  1. 1 1
      costmodel/aggregations.go

+ 1 - 1
costmodel/aggregations.go

@@ -43,7 +43,7 @@ func ComputeIdleCoefficient(costData map[string]*CostData, cli prometheusClient.
 	if err != nil || totalClusterCost == 0.0 {
 		return 0.0, err
 	}
-	totalClusterCostOverWindow := (totalClusterCost / 730) * windowDuration.Hours()
+	totalClusterCostOverWindow := (totalClusterCost / 730) * windowDuration.Hours() * (1 - discount)
 	totalContainerCost := 0.0
 	for _, costDatum := range costData {
 		cpuv, ramv, gpuv, pvvs := getPriceVectors(costDatum, discount, 1)