@@ -167,29 +167,25 @@ func (p *SchedulerProfile) runFilterPlugins(ctx context.Context, request *types.
167
167
168
168
func (p * SchedulerProfile ) runScorerPlugins (ctx context.Context , request * types.LLMRequest , cycleState * types.CycleState , pods []types.Pod ) map [types.Pod ]float64 {
169
169
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 )
173
171
174
172
weightedScorePerPod := make (map [types.Pod ]float64 , len (pods ))
175
173
for _ , pod := range pods {
176
174
weightedScorePerPod [pod ] = float64 (0 ) // initialize weighted score per pod with 0 value
177
175
}
178
176
// Iterate through each scorer in the chain and accumulate the weighted scores.
179
177
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 ())
181
179
before := time .Now ()
182
180
scores := scorer .Score (ctx , cycleState , request , pods )
183
181
metrics .RecordPluginProcessingLatency (ScorerExtensionPoint , scorer .TypedName ().Type , scorer .TypedName ().Name , time .Since (before ))
184
182
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 )
188
184
weightedScorePerPod [pod ] += enforceScoreRange (score ) * float64 (scorer .Weight ())
189
185
}
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 ())
191
187
}
192
- loggerDebug .Info ("Completed running scorer plugins successfully" )
188
+ logger . V ( logutil . DEBUG ) .Info ("Completed running scorer plugins successfully" )
193
189
194
190
return weightedScorePerPod
195
191
}
0 commit comments