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

Automatically calculating weight / length #43

Open
tcf909 opened this issue Aug 10, 2016 · 3 comments
Open

Automatically calculating weight / length #43

tcf909 opened this issue Aug 10, 2016 · 3 comments

Comments

@tcf909
Copy link

tcf909 commented Aug 10, 2016

On line 129: ", length = Math.floor(percentage * vnodes * servers.length)"

the length is automatically calculated. The problem being with 7 nodes, the length ends up being 39.999999999 (where it should actually be 40) and this then throws off the consistent aspects of calculation (wrong lookups start to occur until the 8th node is added).

@tcf909
Copy link
Author

tcf909 commented Aug 10, 2016

I fixed this on my end by using Math.round instead of Math.floor

@3rd-Eden
Copy link
Owner

On vacation atm, will look at it once im back. But if its a bug, feel free to make a pr for it

On Aug 10, 2016, at 10:05 PM, T.C. Ferguson notifications@github.com wrote:

I fixed this on my end by using Math.round instead of Math.floor


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or mute the thread.

@tcf909
Copy link
Author

tcf909 commented Aug 12, 2016

Posted a small PR at #45

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

No branches or pull requests

2 participants