summaryrefslogtreecommitdiffstats
path: root/collectors
diff options
context:
space:
mode:
authorelelayan <eric.lelay@ariadnext.com>2020-05-28 16:18:36 +0200
committerGitHub <noreply@github.com>2020-05-28 17:18:36 +0300
commitd11ec6f978e357d539a6ab06c97555ed5d25c04b (patch)
tree810847e51c256c959d91328c9fa533748cc89b1e /collectors
parent94ae417854807790e13f06b3c888076af374c579 (diff)
Ceph: Added OSD size collection (#8649)
Diffstat (limited to 'collectors')
-rw-r--r--collectors/python.d.plugin/ceph/ceph.chart.py17
1 files changed, 17 insertions, 0 deletions
diff --git a/collectors/python.d.plugin/ceph/ceph.chart.py b/collectors/python.d.plugin/ceph/ceph.chart.py
index 93a0f37ae3..494eef45d4 100644
--- a/collectors/python.d.plugin/ceph/ceph.chart.py
+++ b/collectors/python.d.plugin/ceph/ceph.chart.py
@@ -31,6 +31,7 @@ ORDER = [
'pool_read_operations',
'pool_write_operations',
'osd_usage',
+ 'osd_size',
'osd_apply_latency',
'osd_commit_latency'
]
@@ -101,6 +102,10 @@ CHARTS = {
'options': [None, 'Ceph OSDs', 'KiB', 'osd', 'ceph.osd_usage', 'line'],
'lines': []
},
+ 'osd_size': {
+ 'options': [None, 'Ceph OSDs size', 'KiB', 'osd', 'ceph.osd_size', 'line'],
+ 'lines': []
+ },
'osd_apply_latency': {
'options': [None, 'Ceph OSDs apply latency', 'milliseconds', 'osd', 'ceph.apply_latency', 'line'],
'lines': []
@@ -189,6 +194,9 @@ class Service(SimpleService):
self.definitions['osd_usage']['lines'].append([osd['name'],
osd['name'],
'absolute'])
+ self.definitions['osd_size']['lines'].append(['size_{0}'.format(osd['name']),
+ osd['name'],
+ 'absolute'])
self.definitions['osd_apply_latency']['lines'].append(['apply_latency_{0}'.format(osd['name']),
osd['name'],
'absolute'])
@@ -217,6 +225,7 @@ class Service(SimpleService):
data.update(self._get_pool_rw(pool_io))
for osd in osd_df['nodes']:
data.update(self._get_osd_usage(osd))
+ data.update(self._get_osd_size(osd))
for osd_apply_commit in osd_perf_infos:
data.update(self._get_osd_latency(osd_apply_commit))
return data
@@ -296,6 +305,14 @@ class Service(SimpleService):
return {osd['name']: float(osd['kb_used'])}
@staticmethod
+ def _get_osd_size(osd):
+ """
+ Process raw data into osd dict information to get osd size (kb)
+ :return: A osd dict with osd name's key and size bytes' value
+ """
+ return {'size_{0}'.format(osd['name']): float(osd['kb'])}
+
+ @staticmethod
def _get_osd_latency(osd):
"""
Get ceph osd apply and commit latency