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 executing requests #119009
Track executing requests #119009
Conversation
/cc @wojtek-t |
faee1f4
to
cd5517c
Compare
/retest |
Thank you for taking this up! When possible, can you share example output from the new debug command? |
@natherz97 : I realized that the design is not obvious (to me, anyway) and posted about that in the issue. I am waiting for feedback on #118746 (comment) |
cd5517c
to
b8381a4
Compare
@natherz97: See the Release Note in the opening comment here. The added column for StartTime is inserted right after the AdditionalLatency column. |
The tracking of executing requests in QueueSet is wrong --- the requests are tracked in each queue, but not every QueueSet has queues. |
b8381a4
to
38891e9
Compare
Bug fixed. |
@natherz97 : here is an example. root@ubu2204a:/var/run/kubernetes# kubectl get --raw /debug/api_priority_and_fairness/dump_requests
PriorityLevelName, FlowSchemaName, QueueIndex, RequestIndexInQueue, FlowDistingsher, ArriveTime, InitialSeats, FinalSeats, AdditionalLatency, StartTime
exempt, exempt, -1, -1, , 2023-07-15T04:51:25.596404345Z, 1, 0, 0s, 2023-07-15T04:51:25.596404345Z |
@MikeSpreitzer thank you! It also looks like dump_requests supports the includeRequestDetails=1 parameter to provide information like the username, verb, and path? |
Yes. I just gave an example of the simpler usage. The columns added by |
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.
I have two comments, but overall this looks reasonable to me.
return ans | ||
} | ||
|
||
func Curry2of2[T1, T2, Return any](f func(T1, T2) Return, v2 T2) func(T1) Return { |
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.
IMHO introducing generic functions if they are used only in a single pattern is an overkill and makes it harder to understand the code (btw the name doesn't really help).
I would much rather prefer to just have:
func dumpRequestsSet(s *sets.Set[*request], includeDetails bool) []RequestDump {
res := make([]RequestDump, 0, s.Len())
for elem := range s {
res = append(res, elem.dump(includeDetails)
}
}
return ans | ||
} | ||
|
||
func OrFuncOverSlice[Elt any](f func(Elt) bool) func([]Elt) bool { |
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.
Given it's a function that is used only in the test, can we move it to that test file? I doubt we will ever remember about this function exists here...
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.
This is a form of map-reduce, I am sure I will remember that map-reduce exists and that I am tired of writing it over and over.
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 it should be
func SliceMapReduce[Elt, Result any](mapFn func(Elt) Result, reduceFn func(Result,Result) Result) func([]Elt) Result {...{
Signed-off-by: Mike Spreitzer <mspreitz@us.ibm.com>
38891e9
to
a8a2fb3
Compare
The force-push to a8a2fb3 removes the currying function and restates the two map-reduce functions in the general form that hopefully makes the hope for more future use clear. |
/lgtm Thanks! |
LGTM label has been added. Git tree hash: 6d471ceb06c3f0cb48ab112ae624d413bda42f86
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: MikeSpreitzer, wojtek-t 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 |
What type of PR is this?
/kind feature
What this PR does / why we need it:
This PR extends API Priority and Fairness to track the individual executing requests and optionally report them through a debug URL.
Which issue(s) this PR fixes:
Fixes #118746
Special notes for your reviewer:
This PR is not done yet, there is an interface design question in #118746 to be resolved first.
This PR builds on #118955 and will be rebased after that one merges.
Does this PR introduce a user-facing change?
Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.: