diff --git a/pkg/epp/scheduling/framework/scheduler_profile.go b/pkg/epp/scheduling/framework/scheduler_profile.go index 6037e3541..9790b9843 100644 --- a/pkg/epp/scheduling/framework/scheduler_profile.go +++ b/pkg/epp/scheduling/framework/scheduler_profile.go @@ -148,8 +148,8 @@ func (p *SchedulerProfile) runFilterPlugins(ctx context.Context, request *types. } func (p *SchedulerProfile) runScorerPlugins(ctx context.Context, request *types.LLMRequest, cycleState *types.CycleState, pods []types.Pod) map[types.Pod]float64 { - loggerDebug := log.FromContext(ctx).V(logutil.DEBUG) - loggerDebug.Info("Before running scorer plugins", "pods", pods) + logger := log.FromContext(ctx) + logger.V(logutil.DEBUG).Info("Before running scorer plugins", "pods", pods) weightedScorePerPod := make(map[types.Pod]float64, len(pods)) for _, pod := range pods { @@ -157,16 +157,17 @@ func (p *SchedulerProfile) runScorerPlugins(ctx context.Context, request *types. } // Iterate through each scorer in the chain and accumulate the weighted scores. for _, scorer := range p.scorers { - loggerDebug.Info("Running scorer plugin", "plugin", scorer.TypedName()) + logger.V(logutil.DEBUG).Info("Running scorer plugin", "plugin", scorer.TypedName()) before := time.Now() scores := scorer.Score(ctx, cycleState, request, pods) metrics.RecordPluginProcessingLatency(ScorerExtensionPoint, scorer.TypedName().Type, scorer.TypedName().Name, time.Since(before)) for pod, score := range scores { // weight is relative to the sum of weights + logger.V(logutil.DEBUG).Info("Calculated score", "plugin", scorer.TypedName(), "endpoint", pod.GetPod().NamespacedName, "score", score) weightedScorePerPod[pod] += enforceScoreRange(score) * float64(scorer.Weight()) } - loggerDebug.Info("Completed running scorer plugin successfully", "plugin", scorer.TypedName()) + logger.V(logutil.DEBUG).Info("Completed running scorer plugin successfully", "plugin", scorer.TypedName()) } - loggerDebug.Info("Completed running scorer plugins successfully") + logger.V(logutil.DEBUG).Info("Completed running scorer plugins successfully") return weightedScorePerPod }