Bug 829826 - rhc-idler-stats reports incorrect number of running apps.
rhc-idler-stats reports incorrect number of running apps.
Status: CLOSED CURRENTRELEASE
Product: OpenShift Origin
Classification: Red Hat
Component: Containers (Show other bugs)
2.x
Unspecified Unspecified
medium Severity low
: ---
: ---
Assigned To: Jhon Honce
libra bugs
: Triaged
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2012-06-07 11:43 EDT by Wesley Hearn
Modified: 2015-05-14 18:55 EDT (History)
4 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2012-06-25 14:27:29 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Wesley Hearn 2012-06-07 11:43:05 EDT
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 11:44:25 EDT
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 17:14:29 EDT
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 18:51:12 EDT
# /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 02:06:44 EDT
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

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