-
Notifications
You must be signed in to change notification settings - Fork 7
Add load based scorer #77
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
left some style comments trying to make code more idiomatic (at least based on my experience).
Please decide which, if any, you'd like to accept.
func (s LoadBasedScorer) Score(ctx *types.SchedulingContext, pods []types.Pod) map[types.Pod]float64 { | ||
var scoredPods map[types.Pod]float64 = make(map[types.Pod]float64) | ||
|
||
for _, pod := range pods { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for _, pod := range pods { | |
for pod := range pods { |
// Score 0 will get pod with number of requests in the queue qual to the threshold used in load-based filter (QueueingThresholdLoRA) | ||
// In future pods with additional capacity will get score higher than 0.5 | ||
func (s LoadBasedScorer) Score(ctx *types.SchedulingContext, pods []types.Pod) map[types.Pod]float64 { | ||
var scoredPods map[types.Pod]float64 = make(map[types.Pod]float64) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: score
would have been a good variable name as well (and shorter):
scorePods[pod] = ...
is repetitive, IMHO, and score[pod] = ...
is just as readable.
unclear what issue reference that is intended to do in the commit comment. |
Fix #66 |
Load-based scorer is based on number of requests in the waiting queue.
It completes the LowQueueFilter, pods with number of waiting requests higher than a threshold is filtered out, pods with number of waiting requests lower than the threshold gets score below 0.5
Ref #66