-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Datausage plugin #247
Datausage plugin #247
Conversation
…ltiple periods and limits - The ratelimiting earlier would allow only one throttle limit per API. Now this change will allow us to have multiple ratelimiting limits for different periods. - Also, the value.limit and value.period configs are combined into a single value.limit config - Check multiple rate limiting periods(if any) during plugin execution - Additional test cases for the multiple ratelimiting options per API - Including all periods in the ratelimit headers
…ble names, coding convention etc. Also fix test cases
I have a lot of questions and observations to make about this:
The way I see it, the ratelimiting plugin could have 2 options (probably with better names): How does that sound? Less confusion as to what each plugin is doing, less code duplication. |
I was not a big fan of mixing up rate-limiting with the data usage counter. There will be(actually we even have a scenarios in our API) scenarios, where you set a API call limit of 10 reqs/second and also set a data limit of only 10,000 records per month. It is then more confusing have different type of limits for the Also this data usage is very specific to our use case, most people out there would use '# of calls' based ratelimiting only. So better to keep this out of core. |
@thibaultcha. Please check my responses inline. I have a lot of questions and observations to make about this:
We have a forked repo (mashape/kong) master branch at our org and started customizing code based on our needs and @tamizhgeek has already merged his changes (PR) to this forked master after which I checked out the code to work on this. That's why you are seeing his changes. May be i can create a fork from your latest master branch and will work on for this.
Doing rate limiting on data/api call should be separate, since there is a lot of complexity involved because it is beast with lots of use cases. I agree with you that we can modify the same plugin and can achieve the intended behaviour but eventually will ended up with a huge plugin which can become unmanageable. I agree with @thefosk having micro plugins is good idea which is simple to understand, easy to configure Move the common code into a library and can reuse it.
I know about migrations and its purpose. But this was not intentionally done. I have added a migration for this. Looks like something wrong with my merging changes.
|
Then we need to find a way to not duplicate that much code. |
Another node @jeevan1986: You will be surprised how many ppl need limits per custom object (you're not an edge case). On Mashape marketplace 30%-40% of limits are custom. Like SMS companies charge per SMS, Video API is by minutes, a Machine Learning API charge per tweet processed, words, etc. |
@tamizhgeek @jeevanrd just heads up. We're working on this one. Data Usage as terminology is not widely recognized in the API mgmt space. Will be: Rate Limiting by Response |
@sinzone thanks for keeping posted. |
See #493 |
Thanks! |
* feat(cache) aggressively cache the kong development / test image * chore(squash) TIL docker build --squash * Revert "chore(squash) TIL docker build --squash" This reverts commit 3c6aa17f3ed97784eb019d8024750080e07b780c.
I have started to implement plugin for datausage and coded some basic stuff. Please review it and let me know your thoughts.