Bug 1318934

Summary: Percentage of available cpu/memory shown on project quota metrics donut is not accurate
Product: OKD Reporter: Yanping Zhang <yanpzhan>
Component: Management ConsoleAssignee: Samuel Padgett <spadgett>
Status: CLOSED CURRENTRELEASE QA Contact: Yadan Pei <yapei>
Severity: medium Docs Contact:
Priority: medium    
Version: 3.xCC: aos-bugs, mmccomas
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-05-12 17:15:31 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:
Attachments:
Description Flags
used-cpu
none
available-cpu none

Description Yanping Zhang 2016-03-18 08:15:00 UTC
Description of problem:
When quota/limits added on project ,create pod in project. On web console setting page, check the used percentage ratio and available percentage ratio of cpu and memory on the project quota metrics donut. The available percentage ratio is not accurate sometimes, so the sum of used percentage ratio and available percentage ratio  is not 100%.
Refer to attachment.

Version-Release number of selected component (if applicable):
openshift v1.1.4-16-gb5da002
kubernetes v1.2.0-origin-41-g91d3e75
etcd 2.2.5


How reproducible:
Always

Steps to Reproduce:
1.Make sure quota/limits added on project, create pod in project. eg:
# oc run testpod --image=openshift/hello-openshift --requests='cpu=15m,memory=50Mi'  -n prozyp
2.After pod is running ,check the used percentage ratio and available percentage ratio of cpu and memory on the project quota metrics donut
3.

Actual results:
2.The available percentage ratio is not accurate, and the sum of used percentage ratio and available percentage ratio  is not 100%

Expected results:
2.The percentage ratio should be right and the sum of used percentage ratio and available percentage ratio should be 100%

Additional info:

Comment 1 Yanping Zhang 2016-03-18 08:18:20 UTC
Created attachment 1137711 [details]
used-cpu

Comment 2 Samuel Padgett 2016-03-18 12:51:44 UTC
I don't see anything wrong in the screenshot. We're displaying percent used of total in the tooltip. We don't show the amount available anywhere.

15m used out of 1 core is 1.5% of the total. 1 core is the total.

Comment 3 Yanping Zhang 2016-03-21 02:04:12 UTC
Created attachment 1138391 [details]
available-cpu

Comment 4 Yanping Zhang 2016-03-21 03:25:07 UTC
Samuel:
  Sorry, I didn't  notice that another screenshot failed to be attached on. Pls check attachments again, The sum of available cpu ratio and the used cpu ratio is not 100%. Thanks!

Comment 5 Samuel Padgett 2016-03-21 10:49:46 UTC
Thanks, I understand now. Here is the fix:

https://github.com/openshift/origin/pull/8161

Comment 6 Yanping Zhang 2016-03-23 07:52:19 UTC
Tested on devenv-rhel7_3800:
openshift v1.1.4-198-g840e8fc
kubernetes v1.2.0-36-g4a3f9c5
etcd 2.2.5

When quota/limit are added on project, create a pod in project, check the used ratio and available ratio, they are precise and the sum is 100% now.

The bug has been fixed, so move it to Verified.