Observing throttle usage #653
Unanswered
derekargueta
asked this question in
Questions (Q&A)
Replies: 1 comment
-
Hi @derekargueta, I moved the issue to a discussion if that's fine.
Let me see if I understand your question. Given a throttle setup, you want to know for each discriminator how close it was to getting throttled? For example if you have Rack::Attack.throttle("requests by ip", limit: 5, period: 2) do |request|
request.ip
end You want to know for each period (2 secs) and each discriminator (IP) how many requests were made so to know how close they were to the limit (5 reqs) ? I don't think there is any kind of instrumentation for that, only when a request if matched we notify it. That said, you might be able to achieve your goal in some other ways. For example:
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Is there a way to instrument how much of the throttle quotas get used? As some kind of histogram, i.e. what the 50th percentile usage was, to inform whether the limits could use a little tightening. I'd imagine this getting captured when the period resets.
Beta Was this translation helpful? Give feedback.
All reactions