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

Chargeback: Skip calculation when there is zero consumed hours #13723

Merged
merged 1 commit into from
Feb 3, 2017

Conversation

isimluk
Copy link
Member

@isimluk isimluk commented Feb 1, 2017

Consumed_hours_in_interval are used for calculating average metrics. When you divide by zero you get Infinity as a result. The report formater breaks when it gets Infinity.

    WARN -- : <AuditFailure> MIQ(Async.rescue in _async_generate_table) userid: [admin] - Infinity
    ERROR -- : MIQ(MiqQueue#deliver) Message id: [6427], Error: [Infinity]
    ERROR -- : [FloatDomainError]: Infinity  Method:[rescue in deliver]
    ERROR -- : activesupport-5.0.0.1/lib/active_support/number_helper/number_to_human_size_converter.rb:53:in `to_i'

This is a corner case. It can happen only few hours after you add provider with C&U. Then it is possible some metric rollup exists in the interval, while the full consumed hours is zero.

Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1416626

@miq-bot add_label chargeback, bug, euwe/yes, blocker
@miq-bot assign @gtanzillo

Consumed_hours_in_interval are used for calculating average consumption.
When you divide by zero you get Infinity as a result. The report
formatter breaks when it find Infinity record.

    WARN -- : <AuditFailure> MIQ(Async.rescue in _async_generate_table) userid: [admin] - Infinity
    ERROR -- : MIQ(MiqQueue#deliver) Message id: [6427], Error: [Infinity]
    ERROR -- : [FloatDomainError]: Infinity  Method:[rescue in deliver]
    ERROR -- : activesupport-5.0.0.1/lib/active_support/number_helper/number_to_human_size_converter.rb:53:in `to_i'

This is corner case. It can happen only few hours after you add provider
with C&U. Then it is possible some metric rollup exists in the interval,
while the full consumed hours is zero.

Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1416626
@miq-bot
Copy link
Member

miq-bot commented Feb 1, 2017

Checked commit isimluk@526b0df with ruby 2.2.6, rubocop 0.47.1, and haml-lint 0.20.0
1 file checked, 0 offenses detected
Everything looks good. 👍

Copy link
Member

@gtanzillo gtanzillo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/looks good 👍

@gtanzillo gtanzillo added this to the Sprint 54 Ending Feb 13, 2017 milestone Feb 3, 2017
@gtanzillo gtanzillo merged commit bf42c47 into ManageIQ:master Feb 3, 2017
simaishi pushed a commit that referenced this pull request Feb 3, 2017
Chargeback: Skip calculation when there is zero consumed hours
(cherry picked from commit bf42c47)

https://bugzilla.redhat.com/show_bug.cgi?id=1419186
@simaishi
Copy link
Contributor

simaishi commented Feb 3, 2017

Euwe backport details:

$ git log -1
commit 64ebc5c2e0b07691caddb073d1a0d51f4941763c
Author: Gregg Tanzillo <[email protected]>
Date:   Fri Feb 3 12:08:44 2017 -0500

    Merge pull request #13723 from isimluk/rhbz#1416626
    
    Chargeback: Skip calculation when there is zero consumed hours
    (cherry picked from commit bf42c47c4efa898230c0c355fdd61ad638fb6c47)
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1419186

isimluk added a commit to isimluk/manageiq that referenced this pull request Feb 6, 2017
After we backported ManageIQ#13723 we found that one test fails as it process
metric rollups that are older than the vm (that wouldn't happen outside
of tests).
@isimluk isimluk deleted the rhbz#1416626 branch February 15, 2017 08:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants