Skip to content

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

Description

@majormoses

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

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions