Gathering OpenShift Enterprise 2 Usage Metrics

Updated -

The oo-stats script is available from the public openshift-extras repository on github:

The purpose of oo-stats is to provide visibility into OpenShift-specific concepts like gears, node host capacity, districts, cartridge usage, and cloud users. It is intended to augment, not replace, standard systems metrics that may be gathered by monitoring solutions. As a proof of concept, it is also intended to elicit feedback about desired features for the supported OpenShift Enterprise product.

Metrics on gear usage and capacity are gathered per node host and summarized by district and profile. Optionally, the database is scanned for cartridge, gear, application, and user statistics to combine with the host metrics. Data can be output in a simple text summary or dumped in multiple machine-readable formats for use in spreadsheets or analysis tools / monitoring solutions. This script can also be used as a library from other Ruby scripts, making many customizations simple.

oo-stats has a number of options and features; be sure to read the leading comments and run it with "-h" for the usage statement. Most metrics are also defined in comments. Also note the present limitations. Improvements are in progress, but the most important improvements are probably ones we won't know about until our customers ask for them.

Here is some example output:


# oo-stats --level profile ------------------------ Profile 'small' summary: ------------------------ District count : 1 Node count : 2 Nodes active : 2 Nodes inactive : 0 District capacity : 6000 Dist avail capacity : 5958 Dist avail uids : 5958 Total gears : 36 Total active gears : 28 Effective available gears : 172 Lowest active capacity pct : 13.0 Highest active capacity pct : 15.0 Avg active capacity pct : 14.0 Districts: Name NodeCount DistAvailCapacity #ActiveGears EffectiveAvailGears AvgActiveCapacityPct -------------- --------- ----------------- ------------ ------------------- -------------------- small_district 2 5958 28 172 14.0 # oo-stats --level node --db -------------------------------- Usage of apps and gears by user: -------------------------------- Login Apps Gears MediumApps MediumGears SmallApps SmallGears ------ ---- ----- ---------- ----------- --------- ---------- user1 21 38 0 0 21 38 user2 3 6 1 2 2 4 ------------------------------------------------ Distribution of apps usage (app count : users) : ------------------------------------------------ 3 : 1 21 : 1 -------------------------------------------------- Distribution of gears usage (gear count : users) : -------------------------------------------------- 6 : 1 38 : 1 -------------------------------- System-wide usage of cartridges: -------------------------------- diy-0.1 : 1 haproxy-1.4 : 14 jbosseap-6.0 : 3 jbossews-1.0 : 3 jenkins-1.4 : 1 mysql-5.1 : 15 perl-5.10 : 7 php-5.3 : 3 python-2.6 : 4 ruby-1.8 : 7 ruby-1.9 : 9 Nodes for district 'custom_district' with profile 'custom': Name #Gears MaxGears Capacity ActiveGears MaxActiveGears ActiveCapacity ----- ------ -------- -------- ----------- -------------- -------------- node4 0 100 0.0 0 100 0.0 Nodes for district 'medium_district' with profile 'medium': Name #Gears MaxGears Capacity ActiveGears MaxActiveGears ActiveCapacity ----- ------ -------- -------- ----------- -------------- -------------- node3 2 100 2.0 2 100 2.0 Nodes for district 'small_district' with profile 'small': Name #Gears MaxGears Capacity ActiveGears MaxActiveGears ActiveCapacity ----- ------ -------- -------- ----------- -------------- -------------- node1 17 100 17.0 13 100 13.0 node2 19 100 19.0 15 100 15.0 ------------------------ Summary for all systems: ------------------------ Apps : 24 Districts : 3 Gears : 44 Nodes : 4 Profiles : 3