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

Mitigate rate limiter slow down due to rounding error #2

Merged
merged 2 commits into from
Dec 30, 2014

Conversation

ryana
Copy link
Contributor

@ryana ryana commented Dec 30, 2014

Use to_f instead of to_i to avoid slowing down the rate limiter. Checkout this ticket I opened on the sidekiq-rate-limiter gem. Basically, using to_i introduces huge rounding errors (technically, a floor-ing error) that can significantly slow things down over time.

Use to_f instead of to_i to avoid slowing down the rate limiter
@coveralls
Copy link

Coverage Status

Coverage decreased (-63.88%) when pulling 469fcfe on ryana:master into be6a61a on seanxiesx:master.

@seanxiesx
Copy link
Owner

thanks @ryana
can we change the timestamps in tests to floats as well?

also looks like there is an unrelated rspec version issue causing the build to fail i'll fix that

@coveralls
Copy link

Coverage Status

Coverage decreased (-63.88%) when pulling 850a50b on ryana:master into be6a61a on seanxiesx:master.

seanxiesx added a commit that referenced this pull request Dec 30, 2014
Mitigate rate limiter slow down due to rounding error
@seanxiesx seanxiesx merged commit 4b71621 into seanxiesx:master Dec 30, 2014
@seanxiesx
Copy link
Owner

pushed 0.0.8 to rubygems
thanks for the PR @ryana (:

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

Successfully merging this pull request may close these issues.

None yet

3 participants