Skip to content

Commit f22f988

Browse files
committed
trace logging for scores per pod
Signed-off-by: Nir Rozenbaum <[email protected]>
1 parent 5b4fbb9 commit f22f988

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

pkg/epp/scheduling/framework/scheduler_profile.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,9 @@ func (p *SchedulerProfile) runFilterPlugins(ctx context.Context, request *types.
166166
}
167167

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

172174
weightedScorePerPod := make(map[types.Pod]float64, len(pods))
@@ -180,6 +182,9 @@ func (p *SchedulerProfile) runScorerPlugins(ctx context.Context, request *types.
180182
scores := scorer.Score(ctx, cycleState, request, pods)
181183
metrics.RecordPluginProcessingLatency(ScorerExtensionPoint, scorer.TypedName().Type, scorer.TypedName().Name, time.Since(before))
182184
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+
}
183188
weightedScorePerPod[pod] += enforceScoreRange(score) * float64(scorer.Weight())
184189
}
185190
loggerDebug.Info("Completed running scorer plugin successfully", "plugin", scorer.TypedName())

0 commit comments

Comments
 (0)