-
Notifications
You must be signed in to change notification settings - Fork 505
Adding rate limiting statistics api #11424
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
base: develop
Are you sure you want to change the base?
Conversation
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
@@ -0,0 +1,44 @@ | |||
Rate Limiting |
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.
Are you removing this text from installation/config.rst? (or is it going to link here as well?)
... I don't have a preference personally.
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 think it should be in both places but I can remove it if you think it's redundant. @pdurbin ?
CSV dump of Rate Limiting Cache | ||
|
||
curl http://localhost:8080/api/admin/rateLimitStats | ||
curl http://localhost:8080/api/admin/rateLimitStats?deltaMinutesFilter=10 |
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 like it. The deltaMinutesFilter parameter will be useful, I think.
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.
Some quick feedback.
In order to monitor the rate limiting cache for investigative purposes there is a stats endpoint which returns CSV formatted text. The CSV contains multiple lists. | ||
The first list contains the username:command, and number of tokens remaining. This list is sorted by the values and has the header "#<username>:<command>, <available tokens>". | ||
The second list contains username:command, last updated timestamp in minutes, and delta minutes before now. The header for this list is "#<username>:<command>, <timestamp>, <delta minutes> ## deltaMinutesFilter=1". | ||
This list can be filtered to show only the entries with updates within the deltaMinutesFilter requested. ("## deltaMinutesFilter=n" will be added to the header when the filter is included in the call. |
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.
The above is great content but it's a little smooshed together in the HTML version: https://dataverse-guide--11424.org.readthedocs.build/en/11424/admin/rate_limiting.html#statistics
Maybe add some newlines?
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.
reformatted
📦 Pushed preview images as
🚢 See on GHCR. Use by referencing with full name as printed above, mind the registry name. |
What this PR does / why we need it: Dev/Dev Ops needs an API to see the current state that Rate Limiting is in. I.E. number of users being limited, number of available bucket tokens for a command, other info TBD.
Which issue(s) this PR closes:#11413
Special notes for your reviewer:
Suggestions on how to test this:
Does this PR introduce a user interface change? If mockups are available, please link/include them here:
Is there a release notes update needed for this change?: Included
Additional documentation: Admin api doc