"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "plugins/dstat_gpfs.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_gpfs.py  (dstat-0.7.3):dstat_gpfs.py  (dstat-0.7.4)
skipping to change at line 20 skipping to change at line 20
self.nick = ('read', 'write') self.nick = ('read', 'write')
self.vars = ('_br_', '_bw_') self.vars = ('_br_', '_bw_')
def check(self): def check(self):
if os.access('/usr/lpp/mmfs/bin/mmpmon', os.X_OK): if os.access('/usr/lpp/mmfs/bin/mmpmon', os.X_OK):
try: try:
self.stdin, self.stdout, self.stderr = dpopen('/usr/lpp/mmfs/bin /mmpmon -p -s') self.stdin, self.stdout, self.stderr = dpopen('/usr/lpp/mmfs/bin /mmpmon -p -s')
self.stdin.write('reset\n') self.stdin.write('reset\n')
readpipe(self.stdout) readpipe(self.stdout)
except IOError: except IOError:
raise Exception, 'Cannot interface with gpfs mmpmon binary' raise Exception('Cannot interface with gpfs mmpmon binary')
return True return True
raise Exception, 'Needs GPFS mmpmon binary' raise Exception('Needs GPFS mmpmon binary')
def extract(self): def extract(self):
try: try:
self.stdin.write('io_s\n') self.stdin.write('io_s\n')
# readpipe(self.stderr) # readpipe(self.stderr)
for line in readpipe(self.stdout): for line in readpipe(self.stdout):
if not line: continue if not line: continue
l = line.split() l = line.split()
for name in self.vars: for name in self.vars:
self.set2[name] = long(l[l.index(name)+1]) self.set2[name] = int(l[l.index(name)+1])
for name in self.vars: for name in self.vars:
self.val[name] = (self.set2[name] - self.set1[name]) * 1.0 / ela psed self.val[name] = (self.set2[name] - self.set1[name]) * 1.0 / ela psed
except IOError, e: except IOError as e:
if op.debug > 1: print '%s: lost pipe to mmpmon, %s' % (self.filenam if op.debug > 1: print('%s: lost pipe to mmpmon, %s' % (self.filenam
e, e) e, e))
for name in self.vars: self.val[name] = -1 for name in self.vars: self.val[name] = -1
except Exception, e: except Exception as e:
if op.debug > 1: print '%s: exception %s' % (self.filename, e) if op.debug > 1: print('%s: exception %s' % (self.filename, e))
for name in self.vars: self.val[name] = -1 for name in self.vars: self.val[name] = -1
if step == op.delay: if step == op.delay:
self.set1.update(self.set2) self.set1.update(self.set2)
# vim:ts=4:sw=4:et # vim:ts=4:sw=4:et
 End of changes. 5 change blocks. 
8 lines changed or deleted 8 lines changed or added

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