commit | b8561e4b87de097fc2e6a22fbb6af607cfc60412 | [log] [tgz] |
---|---|---|
author | Swann Croiset <scroiset@mirantis.com> | Tue Mar 07 12:21:55 2017 +0100 |
committer | Swann Croiset <scroiset@mirantis.com> | Wed Mar 08 15:38:58 2017 +0100 |
tree | 46844a97241bdca0c699b204598f3f62352560ec | |
parent | 562c7b3c03ddfde017b68c6677e31c1cec69469c [diff] |
Add NotReady nodes percentage metric Change-Id: I403d06f10a589370fa40ad08a0fcb6d3ec237ba4
diff --git a/collectd/files/plugin/collectd_k8s_kubectl_get.py b/collectd/files/plugin/collectd_k8s_kubectl_get.py index 324867d..1333120 100644 --- a/collectd/files/plugin/collectd_k8s_kubectl_get.py +++ b/collectd/files/plugin/collectd_k8s_kubectl_get.py
@@ -94,6 +94,12 @@ if self._check_conditions(conditions, _type='Ready'): total_ready += 1 total += 1 + if total > 0: + yield {'values': (100.0 * (total - total_ready)) / total, + 'plugin_instance': 'nodes_percent', + 'meta': {'status': 'not_ready'}, + } + yield {'values': total_ready, 'plugin_instance': 'nodes', 'meta': {'status': 'ready'},