-
Notifications
You must be signed in to change notification settings - Fork 251
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
Track number of active running workloads per queue #295
Track number of active running workloads per queue #295
Conversation
Change-Id: Iac98b009808de37b70b93ccf7f1b77fcd03a21fc
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: alculquicondor The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Part of #259 |
pkg/cache/cache.go
Outdated
Workloads: map[string]*workload.Info{}, | ||
Name: cq.Name, | ||
Workloads: map[string]*workload.Info{}, | ||
wlCountPerQueue: make(map[string]int), |
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.
can we unify the way we allocate the two maps, no preference on my side.
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.
Done
pkg/cache/cache.go
Outdated
// The following fields are not populated in a snapshot. | ||
|
||
// The number of admitted workloads per queue. | ||
wlCountPerQueue map[string]int |
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.
perhaps admittedWorkloadsPerQueue
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.
Done
utiltesting.MakeWorkload("job1", "ns1").Queue("alpha").Admit(utiltesting.MakeAdmission("foo").Obj()).Obj(), | ||
utiltesting.MakeWorkload("job2", "ns2").Queue("beta").Admit(utiltesting.MakeAdmission("foo").Obj()).Obj(), | ||
utiltesting.MakeWorkload("job3", "ns1").Queue("gamma").Admit(utiltesting.MakeAdmission("bar").Obj()).Obj(), | ||
utiltesting.MakeWorkload("job4", "ns2").Queue("beta").Admit(utiltesting.MakeAdmission("foo").Obj()).Obj(), |
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.
perhaps add an unadmitted workload? I know a workload that is not yet admitted shouldn't be in the cash, but perhaps worth adding one anyways just to make sure we don't crash if there is such a bug?
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.
Added in the tests for workloads instead.
Change-Id: If91541b4b91defff2ac1ff1699ca6537b798e6db
/label tide/merge-method-squash |
/lgtm |
* Track number of active running workloads per queue Change-Id: Iac98b009808de37b70b93ccf7f1b77fcd03a21fc * Address review comments Change-Id: If91541b4b91defff2ac1ff1699ca6537b798e6db
What type of PR is this?
/kind feature
What this PR does / why we need it:
This PR doesn't have any user visible changes. The information can be used to populate the information into a Queue status, to improve observability of kueue.
This is a spin off from #291
Which issue(s) this PR fixes:
Part of #259
Special notes for your reviewer: