Bug 829826

Summary: rhc-idler-stats reports incorrect number of running apps.
Product: OKD Reporter: Wesley Hearn <whearn>
Component: ContainersAssignee: Jhon Honce <jhonce>
Status: CLOSED CURRENTRELEASE QA Contact: libra bugs <libra-bugs>
Severity: low Docs Contact:
Priority: medium    
Version: 2.xCC: jhonce, qgong, twiest, xtian
Target Milestone: ---Keywords: Triaged
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-06-25 18:27:29 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 Wesley Hearn 2012-06-07 15:43:05 UTC
Description of problem:
rhc-idler-stats reports incorrect number of apps running.

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

How reproducible:
Always

Steps to Reproduce:
1. rhc-idler-stats
2. Divide number running by max_active_apps(80)
3. Run factor active_capacity (this number is correct)
  
Actual results:
On a node with 50 running apps reported by rhc-idler-stats we get a percent of 62.5 while factor active_capacity reports 66.25.

Expected results:
It should take into account all cartridge types and in this instance report 66.25% 

Additional info:

Comment 1 Thomas Wiest 2012-06-07 15:44:25 UTC
We think that rhc-idler-stats may not be taking the DIY cartridges into account in it's stats.

Comment 2 Thomas Wiest 2012-06-14 21:14:29 UTC
To explain this bug a little more clearly, here's what we were seeing (and some math for what we were expecting).

rhc-idler-stats was saying that there were 50 running apps.

facter was reporting 66.25% active_capacity.

This node was of type small, so that means that max_active_apps = 80.

Therefore, if we divide (66.25 / 100) to get a percent, and then multiple that by 80 (max_active_apps), we get:
(66.25 / 100) * 80 = 53 running apps.

Now, rhc-idler-stats is only reporting that 50 are running.


In the original description, we did the math the other way around where we turned the output from rhc-idler-stats into a percentage of the maximum capacity.

So, 50 / 80 = 0.625 = 62.5%  (again, facter active_capacity reports 66.25%).

I hope this clarifies it a bit.

Comment 3 Jhon Honce 2012-06-14 22:51:12 UTC
# /usr/bin/rhc-idler-stats 
19 running, 20 idled, 1 half-idled for a total 39 of 40 (97.50 %)
# facter active_capacity
23.75

li commit 6cbc445397dae516dec25c71fbb3eaa80af3101a

Comment 4 Xiaoli Tian 2012-06-21 06:06:44 UTC
Verified it on devenv_1861:

[root@ip-10-99-27-79 ~]# facter capacity
3.75

[root@ip-10-99-27-79 ~]# rhc-idler-stats 
3 running, 0 idled, 0 half-idled for a total 3 of 3 (100.00 %)

80*3.75%=3