Skip to content

Commit 7181def

Browse files
committed
code review
Signed-off-by: Nir Rozenbaum <[email protected]>
1 parent f22f988 commit 7181def

File tree

1 file changed

+5
-9
lines changed

1 file changed

+5
-9
lines changed

pkg/epp/scheduling/framework/scheduler_profile.go

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -167,29 +167,25 @@ func (p *SchedulerProfile) runFilterPlugins(ctx context.Context, request *types.
167167

168168
func (p *SchedulerProfile) runScorerPlugins(ctx context.Context, request *types.LLMRequest, cycleState *types.CycleState, pods []types.Pod) map[types.Pod]float64 {
169169
logger := log.FromContext(ctx)
170-
loggerTrace := logger.V(logutil.TRACE)
171-
loggerDebug := logger.V(logutil.DEBUG)
172-
loggerDebug.Info("Before running scorer plugins", "pods", pods)
170+
logger.V(logutil.DEBUG).Info("Before running scorer plugins", "pods", pods)
173171

174172
weightedScorePerPod := make(map[types.Pod]float64, len(pods))
175173
for _, pod := range pods {
176174
weightedScorePerPod[pod] = float64(0) // initialize weighted score per pod with 0 value
177175
}
178176
// Iterate through each scorer in the chain and accumulate the weighted scores.
179177
for _, scorer := range p.scorers {
180-
loggerDebug.Info("Running scorer plugin", "plugin", scorer.TypedName())
178+
logger.V(logutil.DEBUG).Info("Running scorer plugin", "plugin", scorer.TypedName())
181179
before := time.Now()
182180
scores := scorer.Score(ctx, cycleState, request, pods)
183181
metrics.RecordPluginProcessingLatency(ScorerExtensionPoint, scorer.TypedName().Type, scorer.TypedName().Name, time.Since(before))
184182
for pod, score := range scores { // weight is relative to the sum of weights
185-
if loggerTrace.Enabled() {
186-
loggerTrace.Info("calculated score", "plugin", scorer.TypedName(), "endpoint", pod.GetPod().NamespacedName, "score", score)
187-
}
183+
logger.V(logutil.TRACE).Info("calculated score", "plugin", scorer.TypedName(), "endpoint", pod.GetPod().NamespacedName, "score", score)
188184
weightedScorePerPod[pod] += enforceScoreRange(score) * float64(scorer.Weight())
189185
}
190-
loggerDebug.Info("Completed running scorer plugin successfully", "plugin", scorer.TypedName())
186+
logger.V(logutil.DEBUG).Info("Completed running scorer plugin successfully", "plugin", scorer.TypedName())
191187
}
192-
loggerDebug.Info("Completed running scorer plugins successfully")
188+
logger.V(logutil.DEBUG).Info("Completed running scorer plugins successfully")
193189

194190
return weightedScorePerPod
195191
}

0 commit comments

Comments
 (0)