-
Notifications
You must be signed in to change notification settings - Fork 17.5k
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
proposal: x/time/rate: expose number of available tokens for metrics/testing #18233
Comments
@liggitt see https://go-review.googlesource.com/#/c/29958/ for my attempt. The discussion on that change basically boils down to Kubernetes' queue saturation metric being a fundamentally broken calculation. |
ah, didn't know you'd already pursued that... I just opened https://go-review.googlesource.com/#/c/34112/ |
Sorry for letting this slip through the cracks. @dsnet, can you either own this or figure out who does own x/time/rate? And then have the owner review the CLs above? |
I'd like to re-open this issue. In addition to metrics, this is also useful for computing a time duration for a request to retry after. |
What version of Go are you using (
go version
)?1.6
What operating system and processor architecture are you using (
go env
)?darwin/amd64
What did you do?
Using golang.org/x/time/rate#Limiter in kubernetes, we have a need to monitor ratelimiters for saturation. To do that, we need the capacity (available via Burst()) and the current availability. The latter is not exposed in the Limiter API.
What did you expect to see?
A thread-safe
Available()
method that returns (but does not reserve) the number of currently available tokens.Something like this, perhaps:
What did you see instead?
No visibility to the number of available tokens at a given point in time
The text was updated successfully, but these errors were encountered: