"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "plugins/dstat_md_status.py" between
dstat-0.7.3.tar.gz and dstat-0.7.4.tar.gz

About: dstat is a versatile resource statistic tool and a replacement for vmstat, iostat and ifstat (using Python).

dstat_md_status.py  (dstat-0.7.3):dstat_md_status.py  (dstat-0.7.4)
skipping to change at line 26 skipping to change at line 26
self.name = 'sw raid' self.name = 'sw raid'
self.type = 's' self.type = 's'
self.scale = 0 self.scale = 0
self.nick = ('pct speed', ) self.nick = ('pct speed', )
self.width = 9 self.width = 9
self.vars = ('text', ) self.vars = ('text', )
self.open('/proc/mdstat') self.open('/proc/mdstat')
def check(self): def check(self):
if not os.path.exists('/proc/mdstat'): if not os.path.exists('/proc/mdstat'):
raise Exception, 'Needs kernel md support' raise Exception('Needs kernel md support')
def extract(self): def extract(self):
pct = 0 pct = 0
speed = 0 speed = 0
nr = 0 nr = 0
for l in self.splitlines(): for l in self.splitlines():
if len(l) < 2: continue if len(l) < 2: continue
if l[1] in ('recovery', 'reshape', 'resync'): if l[1] in ('recovery', 'reshape', 'resync'):
nr += 1 nr += 1
pct += int(l[3][0:2].strip('.%')) pct += int(l[3][0:2].strip('.%'))
 End of changes. 1 change blocks. 
1 lines changed or deleted 1 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)