|
|
@@ -220,7 +220,12 @@ func AggregateCostData(costData map[string]*CostData, field string, subfields []
|
|
|
// It is possible to score > 100% efficiency, which is meant to be interpreted as a red flag.
|
|
|
// It is not possible to score < 0% efficiency.
|
|
|
|
|
|
- agg.CPUEfficiency = 100.0
|
|
|
+ klog.V(1).Infof("\n\tlen(CPU allocation): %d\n\tlen(CPU requested): %d\n\tlen(CPU used): %d",
|
|
|
+ len(agg.CPUAllocationVectors),
|
|
|
+ len(agg.CPURequestedVectors),
|
|
|
+ len(agg.CPUUsedVectors))
|
|
|
+
|
|
|
+ agg.CPUEfficiency = 1.0
|
|
|
CPUIdle := 0.0
|
|
|
avgCPUAllocation := totalVectors(agg.CPUAllocationVectors) / float64(len(agg.CPUAllocationVectors))
|
|
|
if avgCPUAllocation > 0.0 {
|
|
|
@@ -230,7 +235,12 @@ func AggregateCostData(costData map[string]*CostData, field string, subfields []
|
|
|
agg.CPUEfficiency = 1.0 - CPUIdle
|
|
|
}
|
|
|
|
|
|
- agg.RAMEfficiency = 100.0
|
|
|
+ klog.V(1).Infof("\n\tlen(RAM allocation): %d\n\tlen(RAM requested): %d\n\tlen(RAM used): %d",
|
|
|
+ len(agg.RAMAllocationVectors),
|
|
|
+ len(agg.RAMRequestedVectors),
|
|
|
+ len(agg.RAMUsedVectors))
|
|
|
+
|
|
|
+ agg.RAMEfficiency = 1.0
|
|
|
RAMIdle := 0.0
|
|
|
avgRAMAllocation := totalVectors(agg.RAMAllocationVectors) / float64(len(agg.RAMAllocationVectors))
|
|
|
if avgRAMAllocation > 0.0 {
|
|
|
@@ -273,6 +283,8 @@ func aggregateDatum(cp cloud.Provider, aggregations map[string]*Aggregation, cos
|
|
|
aggregations[key] = agg
|
|
|
}
|
|
|
|
|
|
+ klog.V(1).Infoln(costDatum)
|
|
|
+
|
|
|
mergeVectors(cp, costDatum, aggregations[key], rate, discount, idleCoefficient)
|
|
|
}
|
|
|
|