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:
We think that rhc-idler-stats may not be taking the DIY cartridges into account in it's stats.
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.
# /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
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