Bug 1413110

Summary: Discrepancy in resource usage reported between daily, weekly, monthly Chargebcack reports
Product: Red Hat CloudForms Management Engine Reporter: Nandini Chandra <nachandr>
Component: ReportingAssignee: Šimon Lukašík <slukasik>
Status: CLOSED CURRENTRELEASE QA Contact: Nandini Chandra <nachandr>
Severity: high Docs Contact:
Priority: unspecified    
Version: 5.7.0CC: jhardy, obarenbo, simaishi, slukasik
Target Milestone: GAKeywords: TestOnly, ZStream
Target Release: 5.8.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard: chargeback
Fixed In Version: 5.8.0.0 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 1418846 1425916 (view as bug list) Environment:
Last Closed: 2017-06-12 16:44:23 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1418846, 1425916    
Attachments:
Description Flags
Daily Chargeback report
none
Weekly Chargeback report
none
Monthly Chargeback report none

Description Nandini Chandra 2017-01-13 16:34:38 UTC
Description of problem:
-----------------------
I have generated daily, weekly and monthly Chargeback reports on Dec 11 at midnight UTC.

period = 12/07 - 12/10

The resource usage is different in all the 3 reports.

For eg, in the cb-owner-daily - Sun, 11 Dec 2016 00:00:14 +0000 report,I summed up the CPU used for the cu-24x7 VM for 12/07 - 12/10.

Total CPU used = (4.17 + 47.52 + 58.37 + 53.17)MHz
               = 163.23 MH

The weekly report shows that the CPU used is 23.65 MHz for the same period.
The monthly report shows that CPU used is 5.27 MHz for the same period.        

I have attached all the three reports.

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


How reproducible:
-----------------
Always


Steps to Reproduce:
-------------------
1.Manage a provider. Collect C&U data for a few days(4 days in the attached report).
2.Generate daily Chargeback report with this option :
   In the filter tab, in the Chargeback interval section,select 'Day' in the 
   'Show costs by' option in the Chargeback Interval section.
 Generate weekly Chargeback report with this option :
   In the filter tab, in the Chargeback interval section,select 'Week' in the 
   'Show costs by' option Chargeback Interval section.
 Generate monthly Chargeback report with this option :
   In the filter tab, in the Chargeback interval section,select 'Month' in the 
   'Show costs by' option in the Chargeback Interval section.
3.Compare the resource usage reported in the three reports.


Actual results:
---------------
The resource usage in the weekly and monthly reports are incorrect.


Expected results:
-----------------
The resource usage in the weekly and monthly reports should be the same as the resource usage reported in the daily report.


Additional info:
----------------

Comment 2 Nandini Chandra 2017-01-13 16:38:17 UTC
Created attachment 1240409 [details]
Daily Chargeback report

Comment 3 Nandini Chandra 2017-01-13 16:38:43 UTC
Created attachment 1240411 [details]
Weekly Chargeback report

Comment 4 Nandini Chandra 2017-01-13 16:39:17 UTC
Created attachment 1240412 [details]
Monthly Chargeback report

Comment 5 Šimon Lukašík 2017-01-18 09:48:11 UTC
Hello Nandini,

This is very nice find.

I noticed this also when working on bug 1402072. It should be fixed together with bug 1402072.


The problem was:
---------------
We took consumption from metric rollups as A.
We took number of hours in interval (day = 24, week=24*7, month ~~ 24*30) as B.

Then we calculated average as = A/B. The problem was that we cannot use B as it is. We need to use only past hours in given interval.


More Issue like this:
---------------
Imagine you create VM in the middle of month. Then consumption average should be again calculated based on real consumed hours. Not hours in month.

Imagine you retire VM in the middle of month. Then consumption average should be again calculated based on real consumed hours. Not hours in month.

That's all fixed in bug 1402072.

Thanks!

Comment 7 Nandini Chandra 2017-02-06 22:39:22 UTC
Verified in 5.7.1

Comment 8 Nandini Chandra 2017-02-07 19:24:43 UTC
I meant to verify the 5.7.1 clone and not this.

Moving this back to ON_QA.

Comment 9 Nandini Chandra 2017-02-16 19:48:10 UTC
This issue affects 5.6.4 as well.Can this be cloned to 5.6?

Comment 10 Šimon Lukašík 2017-02-22 09:30:05 UTC
I think the answer is yes. This can be cloned. You can use clone button to make the clone for 5.6.

Then, the 3 ack process will be used to decide whether that bug is worth including into the 5.6.

I have no visibility into how many releases are planned for 5.6.z. and I am not sure if there are any written policies for backporting to 5.6. Thus, it is still possible that the clone will never be fixed. However, it is worth filing, as it gives us visibility into what is broken in what versions.

Thanks!

Comment 13 Nandini Chandra 2017-04-13 21:40:41 UTC
Verified in 5.8.0.10