"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "plugins/dstat_vz_cpu.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_vz_cpu.py  (dstat-0.7.3):dstat_vz_cpu.py  (dstat-0.7.4)
skipping to change at line 54 skipping to change at line 54
for name in list: for name in list:
if name in self.discover + ['total']: if name in self.discover + ['total']:
ret.append(name) ret.append(name)
return ret return ret
def extract(self): def extract(self):
self.set2['total'] = [0, 0, 0, 0] self.set2['total'] = [0, 0, 0, 0]
for l in self.splitlines(): for l in self.splitlines():
if len(l) < 6 or l[0] == 'VEID': continue if len(l) < 6 or l[0] == 'VEID': continue
name = l[0] name = l[0]
self.set2[name] = ( long(l[1]), long(l[3]), long(l[4]) - long(l[1]) self.set2[name] = ( int(l[1]), int(l[3]), int(l[4]) - int(l[1]) - in
- long(l[2]) - long(l[3]), long(l[2]) ) t(l[2]) - int(l[3]), int(l[2]) )
self.set2['total'] = ( self.set2['total'][0] + long(l[1]), self.set2 self.set2['total'] = ( self.set2['total'][0] + int(l[1]), self.set2[
['total'][1] + long(l[3]), self.set2['total'][2] + long(l[4]) - long(l[1]) - lon 'total'][1] + int(l[3]), self.set2['total'][2] + int(l[4]) - int(l[1]) - int(l[2
g(l[2]) - long(l[3]), self.set2['total'][3] + long(l[2]) ) ]) - int(l[3]), self.set2['total'][3] + int(l[2]) )
for name in self.vars: for name in self.vars:
for i in range(self.cols): for i in range(self.cols):
self.val[name][i] = 100.0 * (self.set2[name][i] - self.set1[name ][i]) / (sum(self.set2[name]) - sum(self.set1[name])) self.val[name][i] = 100.0 * (self.set2[name][i] - self.set1[name ][i]) / (sum(self.set2[name]) - sum(self.set1[name]))
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. 1 change blocks. 
5 lines changed or deleted 5 lines changed or added

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