Procházet zdrojové kódy

discount should be applied to totalcost

AjayTripathy před 6 roky
rodič
revize
2fdb6080cf
1 změnil soubory, kde provedl 1 přidání a 1 odebrání
  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)