Bug 1468634

Summary: Incorrect Max CPU and Memory usage values displayed
Product: Red Hat CloudForms Management Engine Reporter: Tasos Papaioannou <tpapaioa>
Component: C&U Capacity and UtilizationAssignee: James Wong <jwong>
Status: CLOSED ERRATA QA Contact: Tasos Papaioannou <tpapaioa>
Severity: medium Docs Contact:
Priority: high    
Version: 5.8.0CC: bsorota, dajohnso, jhardy, obarenbo, simaishi, tpapaioa
Target Milestone: GA   
Target Release: 5.9.0   
Hardware: All   
OS: All   
Whiteboard: c&u
Fixed In Version: 5.9.0.4 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-03-01 13:14:47 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:

Description Tasos Papaioannou 2017-07-07 15:18:12 UTC
Description of problem:

The Max values displayed for CPU and CPU Usage, and for Memory and Memory usage, are inconsistent with each other. For example, a VM with seven daily metric rollup records shows the following under Normal Operating Ranges:

CPU 	  	 
Max	46.29 MHz
High	42.20 MHz
Average	37.29 MHz
Low	32.38 MHz

CPU Usage 	  	 
Max	55.99%
High	2.53%
Average	1.47%
Low	0.40%

Memory
Max	69.01 MB
High	69.19 MB
Average	66.85 MB
Low	64.5 MB

Memory Usage  	 
Max	14.99%
High	2.57%
Average	2.31%
Low	2.06%

The max CPU Usage value (55.99%) is found by taking the highest maximum realtime cpu usage value (min_max[:abs_max_cpu_usage_rate_average_value]) from all of the daily metric rollups. This value is ~38 times greater than the Average CPU Usage value (1.47%), yet the corresponding Max and Average CPU (MHz) values differ only by a factor of ~1.24 times. It looks like the Max CPU value is actually being taken from the max value of cpu_usagemhz_rate_average:

vmdb_production=# select max(cpu_usagemhz_rate_average) from metric_rollups where capture_interval_name='daily' and resource_id=636;
       max        
------------------
 46.2881087514149
(1 row)

This is showing the maximum of the daily averages, not the realtime maximum. The same discrepancy can be seen for the Max value under Memory and Memory Usage.

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

5.8.1.0.

How reproducible:

100%

Steps to Reproduce:
1.) Gather one or more days' worth of C&U data for a VM.
2.) View Normal Operating Ranges data for the VM in the web UI.

Actual results:

Inconsistent Max values shown for CPU/CPU Usage and for Memory/Memory Usage.

Expected results:

The Max values displayed for CPU MHz and Memory MB should be consistent with the Max values for CPU Usage and Memory Usage. Either they should both display the all-time realtime max values, or they should both display the max daily average values.

Additional info:

Comment 6 James Wong 2017-10-19 13:33:58 UTC
The fix for CPU is merged: https://github.com/ManageIQ/manageiq/pull/16195

The fix for memory is being reviewed: https://github.com/ManageIQ/manageiq/pull/16224

Comment 7 James Wong 2017-11-15 18:10:11 UTC
Both PRs are merged.

Comment 8 Tasos Papaioannou 2017-11-21 19:36:02 UTC
Verified on 5.9.0.9.

Comment 11 errata-xmlrpc 2018-03-01 13:14:47 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2018:0380