@cryptotaxi247 / netdata-1 / commits / 4d99487f0

add precision to progress value of resync/check/recovery charts

lgz committed Jan 1, 2017 at 22:06 UTC 4d99487f06b2309a2c2f74f38f27e12709106228
1 file changed +6 -5
python.d/mdstat.chart.py
+6 -5
@@ -33,15 +33,16 @@ class Service(SimpleService):
33 self.order.append(''.join([md, '_status']))
34 self.definitions['agr_health']['lines'].append([''.join([md, '_health']), md, 'absolute'])
35 self.definitions[md] = {'options':
36 - [None, 'MD disks stats', 'disks', md, 'md.stats', 'stacked'],
36 + [None, 'MD disks stats', 'disks', md, 'md.disks', 'stacked'],
37 'lines': [[''.join([md, '_total']), 'total', 'absolute'],
38 [''.join([md, '_inuse']), 'inuse', 'absolute']]}
39 self.definitions[''.join([md, '_status'])] = {'options':
40 [None, 'MD current status', 'percent', md, 'md.status', 'line'],
41 - 'lines': [[''.join([md, '_resync']), 'resync', 'absolute'],
42 - [''.join([md, '_recovery']), 'recovery', 'absolute'],
43 - [''.join([md, '_check']), 'check', 'absolute']]}
41 + 'lines': [[''.join([md, '_resync']), 'resync', 'absolute', 1, 100],
42 + [''.join([md, '_recovery']), 'recovery', 'absolute', 1, 100],
43 + [''.join([md, '_check']), 'check', 'absolute', 1, 100]]}
44 self.info('Plugin was started successfully. MDs to monitor %s' % (md_list))
45 + to_netdata = {}
46
47 return True
48
@@ -78,6 +79,6 @@ class Service(SimpleService):
79 to_netdata[''.join([md[0], '_recovery'])] = 0
80
81 for md in mdstat_status:
81 - to_netdata[''.join([md[0], '_' + md[2]])] = round(float(md[3]))
82 + to_netdata[''.join([md[0], '_' + md[2]])] = round(float(md[3]) * 100)
83
84 return to_netdata