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

[BUG] check-aggregate.rb: alert percentages are incorrect due to type casting #53

Open
majormoses opened this issue Jan 18, 2018 · 0 comments
Assignees

Comments

@majormoses
Copy link
Member

majormoses commented Jan 18, 2018

In check-aggregate.rb we cast several options that are percentage based as an integer rather than a float. This means that specifying a float does not do what is expected:

Options improperly cast:

when we compare thresholds this results in an inflated number.
Example:

$ irb
irb(main):001:0> 2.5.class
=> Float
irb(main):002:0> 2.5*100
=> 250.0
irb(main):003:0> 2.5.to_i*100
=> 200
irb(main):04:0> 99.99*100
=> 9999.0
irb(main):005:0> 99.99.to_i*100
=> 9900
@majormoses majormoses self-assigned this Jan 18, 2018
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

1 participant