-
Notifications
You must be signed in to change notification settings - Fork 23
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
Throttle api #184
Throttle api #184
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #184 +/- ##
==========================================
+ Coverage 74.78% 75.83% +1.04%
==========================================
Files 31 32 +1
Lines 1170 1200 +30
==========================================
+ Hits 875 910 +35
+ Misses 295 290 -5 ☔ View full report in Codecov by Sentry. |
176d6b9
to
5f883d9
Compare
572f130
to
cbe472d
Compare
cbe472d
to
0bacea3
Compare
0bacea3
to
53cc8f8
Compare
6fdad6c
to
84bfb08
Compare
84bfb08
to
c16c3d6
Compare
case {RatePerMinutePerProcess < NoOfProcesses, R} of | ||
{true, 0} -> | ||
Config = #{max_n => RatePerMinutePerProcess, | ||
delay => DelayPerProcess + 1, |
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.
why 1
is added to delay
but not max_n
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 really don't get this function
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.
Let me try to add some comments with explanations.
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.
Ok, I've added a property-based test to check that the aggregated delays given to all processes don't differ from the actually requested rate by more than 1%, and I cannot get it to pass 😱
Please have a look at throttle_SUITE:pool_config_property_tests/1
@DenysGonchar
Not only this simplifies how the gradual config is triggered, but it also makes the gradual config transparent to the controller: the controller just applies a new rate every so much time. This not just makes the controller much simpler, but also, makes it possible to give it rate changes that are not necessarily only linear, but that could have more interesting shapes.
d462b4c
to
3141f00
Compare
5d7edbe
to
671e25e
Compare
671e25e
to
73f1e61
Compare
73f1e61
to
92ef315
Compare
Making the API for throttle more friendly to use