"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "plugins/dstat_innodb_io.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_innodb_io.py  (dstat-0.7.3):dstat_innodb_io.py  (dstat-0.7.4)
skipping to change at line 20 skipping to change at line 20
self.vars = ('read', 'write', 'sync') self.vars = ('read', 'write', 'sync')
self.type = 'f' self.type = 'f'
self.width = 3 self.width = 3
self.scale = 1000 self.scale = 1000
def check(self): def check(self):
if os.access('/usr/bin/mysql', os.X_OK): if os.access('/usr/bin/mysql', os.X_OK):
try: try:
self.stdin, self.stdout, self.stderr = dpopen('/usr/bin/mysql -n %s' % mysql_options) self.stdin, self.stdout, self.stderr = dpopen('/usr/bin/mysql -n %s' % mysql_options)
except IOError: except IOError:
raise Exception, 'Cannot interface with MySQL binary' raise Exception('Cannot interface with MySQL binary')
return True return True
raise Exception, 'Needs MySQL binary' raise Exception('Needs MySQL binary')
def extract(self): def extract(self):
try: try:
self.stdin.write('show engine innodb status\G\n') self.stdin.write('show engine innodb status\G\n')
line = matchpipe(self.stdout, '.*OS file reads,.*') line = matchpipe(self.stdout, '.*OS file reads,.*')
if line: if line:
l = line.split() l = line.split()
self.set2['read'] = int(l[0]) self.set2['read'] = int(l[0])
self.set2['write'] = int(l[4]) self.set2['write'] = int(l[4])
self.set2['sync'] = int(l[8]) self.set2['sync'] = int(l[8])
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
if step == op.delay: if step == op.delay:
self.set1.update(self.set2) self.set1.update(self.set2)
except IOError, e: except IOError as e:
if op.debug > 1: print '%s: lost pipe to mysql, %s' % (self.filename if op.debug > 1: print('%s: lost pipe to mysql, %s' % (self.filename
, 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' % (self.filename, e) if op.debug > 1: print('%s: exception' % (self.filename, e))
for name in self.vars: self.val[name] = -1 for name in self.vars: self.val[name] = -1
# vim:ts=4:sw=4:et # vim:ts=4:sw=4:et
 End of changes. 4 change blocks. 
7 lines changed or deleted 7 lines changed or added

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