@@ -13,58 +13,58 @@ import (
1313)
1414
1515const (
16- // LoadAwareScorerType is the type of the LoadAwareScorer
17- LoadAwareScorerType = "load-aware-scorer"
16+ // LoadAwareType is the type of the LoadAware
17+ LoadAwareType = "load-aware-scorer"
1818
1919 // QueueThresholdDefault defines the default queue threshold value
2020 QueueThresholdDefault = 128
2121)
2222
23- type loadAwareScorerParameters struct {
23+ type loadAwareParameters struct {
2424 Threshold int `json:"threshold"`
2525}
2626
2727// compile-time type assertion
28- var _ framework.Scorer = & LoadAwareScorer {}
28+ var _ framework.Scorer = & LoadAware {}
2929
30- // LoadAwareScorerFactory defines the factory function for the LoadAwareScorer
31- func LoadAwareScorerFactory (name string , rawParameters json.RawMessage , handle plugins.Handle ) (plugins.Plugin , error ) {
32- parameters := loadAwareScorerParameters {Threshold : QueueThresholdDefault }
30+ // LoadAwareFactory defines the factory function for the LoadAware
31+ func LoadAwareFactory (name string , rawParameters json.RawMessage , handle plugins.Handle ) (plugins.Plugin , error ) {
32+ parameters := loadAwareParameters {Threshold : QueueThresholdDefault }
3333 if rawParameters != nil {
3434 if err := json .Unmarshal (rawParameters , & parameters ); err != nil {
35- return nil , fmt .Errorf ("failed to parse the parameters of the '%s' scorer - %w" , LoadAwareScorerType , err )
35+ return nil , fmt .Errorf ("failed to parse the parameters of the '%s' scorer - %w" , LoadAwareType , err )
3636 }
3737 }
3838
3939 return NewLoadAwareScorer (handle .Context (), parameters .Threshold ).WithName (name ), nil
4040}
4141
4242// NewLoadAwareScorer creates a new load based scorer
43- func NewLoadAwareScorer (ctx context.Context , queueThreshold int ) * LoadAwareScorer {
43+ func NewLoadAwareScorer (ctx context.Context , queueThreshold int ) * LoadAware {
4444 if queueThreshold <= 0 {
4545 queueThreshold = QueueThresholdDefault
4646 log .FromContext (ctx ).V (logutil .DEFAULT ).Info (fmt .Sprintf ("queueThreshold %d should be positive, using default queue threshold %d" , queueThreshold , QueueThresholdDefault ))
4747 }
4848
49- return & LoadAwareScorer {
50- typedName : plugins.TypedName {Type : LoadAwareScorerType },
49+ return & LoadAware {
50+ typedName : plugins.TypedName {Type : LoadAwareType },
5151 queueThreshold : float64 (queueThreshold ),
5252 }
5353}
5454
55- // LoadAwareScorer scorer that is based on load
56- type LoadAwareScorer struct {
55+ // LoadAware scorer that is based on load
56+ type LoadAware struct {
5757 typedName plugins.TypedName
5858 queueThreshold float64
5959}
6060
6161// TypedName returns the typed name of the plugin.
62- func (s * LoadAwareScorer ) TypedName () plugins.TypedName {
62+ func (s * LoadAware ) TypedName () plugins.TypedName {
6363 return s .typedName
6464}
6565
6666// WithName sets the name of the plugin.
67- func (s * LoadAwareScorer ) WithName (name string ) * LoadAwareScorer {
67+ func (s * LoadAware ) WithName (name string ) * LoadAware {
6868 s .typedName .Name = name
6969 return s
7070}
@@ -76,7 +76,7 @@ func (s *LoadAwareScorer) WithName(name string) *LoadAwareScorer {
7676// Pod with requests in the queue will get score between 0.5 and 0.
7777// Score 0 will get pod with number of requests in the queue equal to the threshold used in load-based filter
7878// In the future, pods with additional capacity will get score higher than 0.5
79- func (s * LoadAwareScorer ) Score (_ context.Context , _ * types.CycleState , _ * types.LLMRequest , pods []types.Pod ) map [types.Pod ]float64 {
79+ func (s * LoadAware ) Score (_ context.Context , _ * types.CycleState , _ * types.LLMRequest , pods []types.Pod ) map [types.Pod ]float64 {
8080 scoredPods := make (map [types.Pod ]float64 )
8181
8282 for _ , pod := range pods {
0 commit comments