Bug 1346047 - The chargeback report gives wrong information
Summary: The chargeback report gives wrong information
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat CloudForms Management Engine
Classification: Red Hat
Component: Reporting
Version: 5.5.0
Hardware: x86_64
OS: Linux
high
urgent
Target Milestone: GA
: 5.8.0
Assignee: Libor Pichler
QA Contact: Nandini Chandra
URL:
Whiteboard: chargeback:report
: 1372838 (view as bug list)
Depends On:
Blocks: 1349413 1414848 1414851
TreeView+ depends on / blocked
 
Reported: 2016-06-13 18:56 UTC by Colin Arnott
Modified: 2020-02-14 17:48 UTC (History)
18 users (show)

Fixed In Version: 5.8.0.0
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
: 1349413 1414848 1414851 (view as bug list)
Environment:
Last Closed: 2017-06-12 17:19:17 UTC
Category: ---
Cloudforms Team: CFME Core
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
all reports together in one screenshot (599.12 KB, image/png)
2016-08-17 12:04 UTC, Libor Pichler
no flags Details
chargeback analysis (3.58 KB, text/plain)
2016-08-19 14:30 UTC, Libor Pichler
no flags Details
evm after hotfix (186.27 KB, text/plain)
2016-10-24 14:17 UTC, Josh Carter
no flags Details
charegeback fixes (91.50 KB, application/x-tar)
2016-12-13 12:29 UTC, Libor Pichler
no flags Details

Description Colin Arnott 2016-06-13 18:56:27 UTC
Description of problem:
I have tried to get the chargeback report from a client in CloudForms 4.0, but i've received a large amount from memory used, storage used, disk i/o used and cpu used, but if you multiply the amount that the report gives by the rates assigned for that user, the result is not the same that i expected. If i've used 8 Ghz in 1 month and the rates for that is $1 USD for 1 month, i've expected that the cost for use is $8 USD, but the report  gave me $0.01 USD. I have the same situation with memory used, disk i/0 used and storage allocated and storage used. I hope that the used item and the cost are right, if i've used 8 GHz in one month and the rates for that is $1 USD for 1 GHZ in month, the cost must give me $8 USD.

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

How reproducible:
nigh impossible

Additional info:
(pending)

Comment 19 Libor Pichler 2016-08-17 12:04:59 UTC
Created attachment 1191602 [details]
all reports together in one screenshot

Comment 22 Libor Pichler 2016-08-19 14:30:06 UTC
Created attachment 1192153 [details]
chargeback analysis

Comment 58 Colin Arnott 2016-09-09 20:13:35 UTC
*** Bug 1372838 has been marked as a duplicate of this bug. ***

Comment 77 CFME Bot 2016-10-21 15:30:58 UTC
New commit detected on ManageIQ/manageiq/euwe:
https://github.com/ManageIQ/manageiq/commit/d1b8be27e9d2208967d52fdb2bcc2326fd0c53a6

commit d1b8be27e9d2208967d52fdb2bcc2326fd0c53a6
Author:     Gregg Tanzillo <gtanzill>
AuthorDate: Wed Oct 19 17:37:49 2016 -0400
Commit:     Oleg Barenboim <chessbyte>
CommitDate: Fri Oct 21 11:26:05 2016 -0400

    Merge pull request #11648 from lpichler/new_chargeback_calculations
    
    New chargeback calculations
    (cherry picked from commit 63996cc5ca543e61d4083af7554701ee21082130)
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1346047

 app/models/chargeback.rb                         | 109 +++++++----
 app/models/chargeback_rate_detail.rb             |  47 ++++-
 spec/models/chargeback_container_image_spec.rb   |   9 +-
 spec/models/chargeback_container_project_spec.rb |  56 ++++--
 spec/models/chargeback_rate_detail_spec.rb       |  18 +-
 spec/models/chargeback_vm_spec.rb                | 233 +++++++++++++++++------
 6 files changed, 352 insertions(+), 120 deletions(-)

Comment 79 Josh Carter 2016-10-24 14:17:19 UTC
Created attachment 1213488 [details]
evm after hotfix

Comment 81 Josh Carter 2016-10-24 14:19:18 UTC
Feedback from the  customer after the hotfix 

"I have made that you request me, but i can't request a chargeback report, i get an error in the GUI (red icon) and i can't select nothing in the chargeback option like rates or assigments, even if i try to make another chargeback report, the option are empty. ¿Should i need do another thing?" 

I have attached the screenshot of the ui error and the evm log.

Comment 100 Libor Pichler 2016-12-13 12:29:30 UTC
Created attachment 1231178 [details]
charegeback fixes

Comment 105 Libor Pichler 2017-01-04 16:26:27 UTC
4.
For formatting to 2 decimals in CPU used is used formatter called 'Megahertz Avg (12.11 Mhz)' in tab format.(for others is used <None>) So please check whether is used this formatter for CPU used. See attachment where to set it up.(Reason is that this formatter is used as default formatter for CPU Used when new report is added.)


>>I want to know something:

1. Yes I believe that it is the reason. Because for allocated metrics (storage allocated) is used maximum of the values on the report interval but for used metrics (CPU Used) is used average of values on the report interval. 
So when VM was shutdown then it certainly affects the used values(for example - storage used).

2. I think that yes, what differences do you mean ? I checked calculations on the reports and they are looks good to me.

Some example from your hourly report:
on the report: metric 'storage allocated' in Oct
Rate for storage allocated is 0.001 hourly (USD/Hour/GB)
Storage allocated: 40 GB
Storage allocated cost: 0.001 (hourly rate) * 40 GB (Storage allocated) * 744 (count of hours in October) = $29.76 (as it is on report)

Comment 108 Šimon Lukašík 2017-01-12 10:17:15 UTC
I think this particular bz should be now in POST.

Comment 110 Šimon Lukašík 2017-01-15 17:27:05 UTC
There have been many prs due to this bz.

We run into problem that multiple unrelated problems and rfes were handled through this single bz. Most of the stuff has been fixed before euwe was branched. Some will be fixed with bring back to euwe with https://github.com/ManageIQ/manageiq/pull/13419

We discussed that with Libor, we think that there are two prs that remain to be backported with this to euwe.

1) Rounding of report to two decimals - https://github.com/ManageIQ/manageiq/pull/12629
2) selecting single rate when multiple rates apply - https://github.com/ManageIQ/manageiq/pull/12534

Comment 112 Šimon Lukašík 2017-01-18 10:13:51 UTC
Again, discussed with Libor.

It seems the best thing to do would be to create a new separate pr for darga to bring this.

During the hotfixes, Libor already did the heavy lifting of rebasing prs from master to darga. It does not make sense to do it again. We should just put these hotfixes to the new pr for darga. What timeframe are we looking into?

Comment 114 Nandini Chandra 2017-03-17 22:15:22 UTC
Verified in 5.8.0.4


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