Achilleas Tzenetopoulos преди 5 години
родител
ревизия
de4612cf67
променени са 1 файла, в които са добавени 3 реда и са изтрити 2 реда
  1. 3 2
      kubernetes-v1.15.4/pkg/scheduler/algorithm/priorities/custom_resource_allocation.go

+ 3 - 2
kubernetes-v1.15.4/pkg/scheduler/algorithm/priorities/custom_resource_allocation.go

@@ -159,9 +159,10 @@ func customResourceScorer(nodeName string) (float64, error) {
 		res := calculateScore(scorerInput{metrics: results}, customScoreFn)
 
 		klog.Infof("Node: %v\t res before: %v", nodeName, res)
-		if sum := average["c6res"]; sum < 1 {
+
+		if sum := average["c6res"] * float64(len(cores)); sum < 1 {
 			klog.Infof("Average C6 is less than 1, so we get: %v", average["c6res"])
-			res = res * sum
+			res = res * average["c6res"]
 		} else {
 			res = res * 1
 		}