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

rabbitmq-queue-metrics.rb: Fix drain_time = 0 check #1247

Closed
wants to merge 1 commit into from

Conversation

andsens
Copy link

@andsens andsens commented Nov 26, 2015

In

drain_time = 0 if drain_time.nan? # 0 rate with 0 messages is 0 time to drain
drain_time is set to 0 in case we divide by 0 in the previous line. Only nan? is used rather that infinite?, division by 0 yields Infinity which is a "number" so nan? is false. Using unless finite? fixes this.

@analytically
Copy link
Contributor

Hi, please check if https://github.com/sensu-plugins/sensu-plugins-rabbitmq also has the same issue. This repository is deprecated.

@andsens
Copy link
Author

andsens commented Nov 30, 2015

Whoa. I gotta stop hitting the /tree/ URLs directly. Didn't even see the depreciation notice. Thank you!

@andsens andsens closed this Nov 30, 2015
@andsens
Copy link
Author

andsens commented Nov 30, 2015

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.

2 participants