Merge pull request #89384 from Huang-Wei/score-printing

Print detailed score results on verbose level 10
This commit is contained in:
Kubernetes Prow Robot 2020-03-26 07:56:25 -07:00 committed by GitHub
commit 1442df8ab3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 6 additions and 16 deletions

View File

@ -647,6 +647,12 @@ func (g *genericScheduler) prioritizeNodes(
return nil, scoreStatus.AsError()
}
if klog.V(10) {
for plugin, nodeScoreList := range scoresMap {
klog.Infof("Plugin %s scores on %v/%v => %v", plugin, pod.Namespace, pod.Name, nodeScoreList)
}
}
// Summarize all scores.
result := make(framework.NodeScoreList, 0, len(nodes))

View File

@ -13,7 +13,6 @@ go_library(
"//staging/src/k8s.io/api/core/v1:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/labels:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/runtime:go_default_library",
"//vendor/k8s.io/klog:go_default_library",
],
)

View File

@ -20,8 +20,6 @@ import (
"context"
"fmt"
"k8s.io/klog"
v1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/labels"
"k8s.io/apimachinery/pkg/runtime"
@ -163,11 +161,6 @@ func (pl *DefaultPodTopologySpread) NormalizeScore(ctx context.Context, state *f
}
}
scores[i].Score = int64(fScore)
if klog.V(10) {
klog.Infof(
"%v -> %v: SelectorSpreadPriority, Score: (%d)", pod.Name, scores[i].Name, int64(fScore),
)
}
}
return nil
}

View File

@ -25,7 +25,6 @@ import (
v1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/labels"
"k8s.io/apimachinery/pkg/util/sets"
"k8s.io/klog"
pluginhelper "k8s.io/kubernetes/pkg/scheduler/framework/plugins/helper"
framework "k8s.io/kubernetes/pkg/scheduler/framework/v1alpha1"
"k8s.io/kubernetes/pkg/scheduler/internal/parallelize"
@ -223,13 +222,6 @@ func (pl *PodTopologySpread) NormalizeScore(ctx context.Context, cycleState *fra
return framework.NewStatus(framework.Error, err.Error())
}
node := nodeInfo.Node()
// Debugging purpose: print the score for each node.
// Score must be a pointer here, otherwise it's always 0.
if klog.V(10) {
defer func(score *int64, nodeName string) {
klog.Infof("%v -> %v: PodTopologySpread NormalizeScore, Score: (%d)", pod.Name, nodeName, *score)
}(&scores[i].Score, node.Name)
}
if maxMinDiff == 0 {
scores[i].Score = framework.MaxNodeScore