Skip to content
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

Would you agree to support a track response support? #79

Closed
flevour opened this issue Aug 8, 2014 · 3 comments
Closed

Would you agree to support a track response support? #79

flevour opened this issue Aug 8, 2014 · 3 comments

Comments

@flevour
Copy link

flevour commented Aug 8, 2014

I am seeing a need to be able to apply track functionality based on response codes.
The possible use case I see is stats tracking of API calls by response code.
I am willing to provide a PR if you think it makes sense to integrate with rack-attack.

@flevour flevour changed the title Do you agree to support a throttle/track response support? Would you agree to support a throttle/track response support? Aug 8, 2014
@flevour flevour changed the title Would you agree to support a throttle/track response support? Would you agree to support a track response support? Aug 8, 2014
@zmillman
Copy link
Contributor

zmillman commented Aug 8, 2014

@flevour why should this be part of rack-attack instead of a separate HTTP code-tracking Rack middleware?

@ktheory
Copy link
Collaborator

ktheory commented Aug 8, 2014

@flevour: Interesting. I'm hesitant to expand the track functionality to include responses. Adding tracks for requests was b/c it was such a close fit to how we're already blocking & throttling other requests.

For simplicity and focus, I'd like to keep parsing responses outside the scope of rack-attack. You could implementing response tracking as a separate middleware or gem (per @zmillman's suggesting).

@ktheory ktheory closed this as completed Aug 8, 2014
@flevour
Copy link
Author

flevour commented Aug 11, 2014

In my case I'd want to throttle only successful requests to API over a given period.
Basically I'm re-using the whole rack-attack count-over-period logic but to throttle responses.
I see your point about simplicity/focus though, thanks for sharing your thoughts!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants