Bug 1567254 - total costs no longer showing in any chargeback report if they are the only columns in the report
Summary: total costs no longer showing in any chargeback report if they are the only c...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat CloudForms Management Engine
Classification: Red Hat
Component: Reporting
Version: 5.8.0
Hardware: All
OS: All
medium
medium
Target Milestone: GA
: 5.10.0
Assignee: Joe Rafaniello
QA Contact: Tasos Papaioannou
URL:
Whiteboard:
Depends On:
Blocks: 1576099 1576101
TreeView+ depends on / blocked
 
Reported: 2018-04-13 16:37 UTC by Felix Dewaleyne
Modified: 2021-09-09 13:42 UTC (History)
8 users (show)

Fixed In Version: 5.10.0.0
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
: 1576099 1576101 (view as bug list)
Environment:
Last Closed: 2019-02-11 14:02:36 UTC
Category: ---
Cloudforms Team: ---
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Bugzilla 1526030 0 medium CLOSED Chargeback report shows incorrect CPU Total Cost and Memory Total Cost if allocated and used costs aren't also displayed 2021-02-22 00:41:40 UTC

Internal Links: 1526030

Description Felix Dewaleyne 2018-04-13 16:37:14 UTC
Description of problem:
total costs no longer showing in any chargeback report if they are the only columns in the report

Version-Release number of selected component (if applicable):
5.8.3.4

How reproducible:
all the time

Steps to Reproduce:
1.upgrade to 5.8.3.4 an old appliance which had reports generated that only use total costs in their columns
2.
3.

Actual results:
the old reports no longer show any data, new reports won't either

Expected results:
consistant behaviour with older versions of cfme showing the total costs

Additional info:
if more rows are added to the reports, new generated reports will show data

Comment 7 Joe Rafaniello 2018-05-02 15:47:02 UTC
> the old reports no longer show any data, new reports won't either

Felix, I guess I was looking at this part too... that new reports weren't working.  Clearly, they were for me.  Are you seeing them work?  I checked that first, because if new reports weren't working, it was highly likely that old reports wouldn't either.

Comment 9 Joe Rafaniello 2018-05-02 16:27:24 UTC
Hi Felix,

See prior attachment.  We have €0.00 in the database directly for the report result details so, either they're mistaken about saved reports showing the correct data or somehow the database rows were modified since they worked.

Are you sure this specific report was working with an older version?  I am confused.

See following attachment of the report I'm asking about... make sure this is the one and followup with what the customer says.

Comment 14 Felix Dewaleyne 2018-05-03 09:15:07 UTC
Upon reviewing the case I'm also mistaken in reporting that reports were empty - they are empty or have a value of 0.

the customer's words were 

Chargeback reports appear with Memory, CPU or Storage Total costs equal to zero if these are the only selected fields.

If I add the following Selected Fields when basing a report on Chargebac for Vms:
Memory Total Cost
CPU Total Cost
Storage Total Cost
Network I/O Used Cost

then, by themselves only the Network shows costs. To make it possible to have a complete costs, one needs also to add to the report the rest of the costs adding up, such as the Memory Allocated Cost, or the vCPUs Allocated cost, which are parts of the cost.

however from the exported reports they provided as you will see in attachment 1430563 [details] there is no value in some of the fields, leading me to this description.

while I'm waiting to hear if they have a copy of their 4.1 database, let me know if this helps.

Comment 15 Joe Rafaniello 2018-05-04 01:53:35 UTC
Felix,

I just wanted to let you know that I have recreated the problem.  There's clearly a bug, where some fields, such as Memory Cost do not get calculated if another field like Memory Allocated Cost isn't also in the report.  This is a bug and we'll fix it.

Note, I did a quick look at the 5.8 vs. 5.7 code and it appears that this problem would have also existed in 5.7. From the prior comments, it's hard to understand if they're saying that this exact same report worked on 5.7.  In other words, I think the same report would have empty values on both 5.7 and 5.8.  I will try to verify what versions that have this problem and report back.

I haven't fixed this yet but wanted to let you know that we understand the problem and how to fix it.

Comment 17 Felix Dewaleyne 2018-05-08 13:11:00 UTC
(In reply to Joe Rafaniello from comment #15)
> Felix,
> 
> I just wanted to let you know that I have recreated the problem.  There's
> clearly a bug, where some fields, such as Memory Cost do not get calculated
> if another field like Memory Allocated Cost isn't also in the report.  This
> is a bug and we'll fix it.
> 
> Note, I did a quick look at the 5.8 vs. 5.7 code and it appears that this
> problem would have also existed in 5.7. From the prior comments, it's hard
> to understand if they're saying that this exact same report worked on 5.7. 
> In other words, I think the same report would have empty values on both 5.7
> and 5.8.  I will try to verify what versions that have this problem and
> report back.
> 
> I haven't fixed this yet but wanted to let you know that we understand the
> problem and how to fix it.

thanks!

Comment 18 CFME Bot 2018-05-08 13:30:50 UTC
New commit detected on ManageIQ/manageiq/master:

https://github.com/ManageIQ/manageiq/commit/4b15db44d33ae6fe68fc861af2a84a112d6c8bf2
commit 4b15db44d33ae6fe68fc861af2a84a112d6c8bf2
Author:     Joe Rafaniello <jrafanie>
AuthorDate: Fri May  4 17:34:10 2018 -0400
Commit:     Joe Rafaniello <jrafanie>
CommitDate: Fri May  4 17:34:10 2018 -0400

    Check all costs fields for relevancy for the report

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

    If a user asks only for some of the fields (memory cost) in a chargeback report
    and they didn't request specific ones (memory allocated cost), we would skip
    calculating the memory cost because we thought it wasn't relevant.  We need to
    check all cost fields to see if they're relevant for the requested fields in the
    report.

 app/models/chargeback_rate_detail.rb | 2 +-
 spec/models/chargeback_vm_spec.rb | 11 +
 2 files changed, 12 insertions(+), 1 deletion(-)

Comment 21 Tasos Papaioannou 2018-07-09 19:13:14 UTC
Verified on 5.10.0.3.


Note You need to log in before you can comment on or make changes to this bug.