mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-23 11:50:44 +00:00
Merge pull request #114216 from alculquicondor/avoid-serialization
Avoid serialization of maps when log level < 10
This commit is contained in:
commit
a800f1e0c0
@ -67,10 +67,12 @@ func (r *resourceAllocationScorer) score(
|
||||
|
||||
score := r.scorer(requested, allocatable)
|
||||
|
||||
klog.V(10).InfoS("Listing internal info for allocatable resources, requested resources and score", "pod",
|
||||
klog.KObj(pod), "node", klog.KObj(node), "resourceAllocationScorer", r.Name,
|
||||
"allocatableResource", allocatable, "requestedResource", requested, "resourceScore", score,
|
||||
)
|
||||
if klogV := klog.V(10); klogV.Enabled() { // Serializing these maps is costly.
|
||||
klogV.InfoS("Listing internal info for allocatable resources, requested resources and score", "pod",
|
||||
klog.KObj(pod), "node", klog.KObj(node), "resourceAllocationScorer", r.Name,
|
||||
"allocatableResource", allocatable, "requestedResource", requested, "resourceScore", score,
|
||||
)
|
||||
}
|
||||
|
||||
return score, nil
|
||||
}
|
||||
|
@ -145,8 +145,9 @@ func (sched *Scheduler) schedulingCycle(
|
||||
if status.Code() == framework.Error {
|
||||
klog.ErrorS(nil, "Status after running PostFilter plugins for pod", "pod", klog.KObj(pod), "status", status)
|
||||
} else {
|
||||
fitError.Diagnosis.PostFilterMsg = status.Message()
|
||||
klog.V(5).InfoS("Status after running PostFilter plugins for pod", "pod", klog.KObj(pod), "status", status)
|
||||
msg := status.Message()
|
||||
fitError.Diagnosis.PostFilterMsg = msg
|
||||
klog.V(5).InfoS("Status after running PostFilter plugins for pod", "pod", klog.KObj(pod), "status", msg)
|
||||
}
|
||||
if result != nil {
|
||||
nominatingInfo = result.NominatingInfo
|
||||
@ -406,8 +407,9 @@ func (sched *Scheduler) findNodesThatFitPod(ctx context.Context, fwk framework.F
|
||||
return nil, diagnosis, s.AsError()
|
||||
}
|
||||
// Record the messages from PreFilter in Diagnosis.PreFilterMsg.
|
||||
diagnosis.PreFilterMsg = s.Message()
|
||||
klog.V(5).InfoS("Status after running PreFilter plugins for pod", "pod", klog.KObj(pod), "status", s)
|
||||
msg := s.Message()
|
||||
diagnosis.PreFilterMsg = msg
|
||||
klog.V(5).InfoS("Status after running PreFilter plugins for pod", "pod", klog.KObj(pod), "status", msg)
|
||||
// Status satisfying IsUnschedulable() gets injected into diagnosis.UnschedulablePlugins.
|
||||
if s.FailedPlugin() != "" {
|
||||
diagnosis.UnschedulablePlugins.Insert(s.FailedPlugin())
|
||||
|
Loading…
Reference in New Issue
Block a user