"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "plugins/dstat_top_childwait.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_top_childwait.py  (dstat-0.7.3):dstat_top_childwait.py  (dstat-0.7.4)
skipping to change at line 29 skipping to change at line 29
for pid in proc_pidlist(): for pid in proc_pidlist():
try: try:
### Using dopen() will cause too many open files ### Using dopen() will cause too many open files
l = proc_splitline('/proc/%s/stat' % pid) l = proc_splitline('/proc/%s/stat' % pid)
except IOError: except IOError:
continue continue
if len(l) < 15: continue if len(l) < 15: continue
### Reset previous value if it doesn't exist ### Reset previous value if it doesn't exist
if not self.set1.has_key(pid): if pid not in self.set1:
self.set1[pid] = 0 self.set1[pid] = 0
self.set2[pid] = int(l[15]) + int(l[16]) self.set2[pid] = int(l[15]) + int(l[16])
usage = (self.set2[pid] - self.set1[pid]) * 1.0 / elapsed / cpunr usage = (self.set2[pid] - self.set1[pid]) * 1.0 / elapsed / cpunr
### Is it a new topper ? ### Is it a new topper ?
if usage <= self.val['max']: continue if usage <= self.val['max']: continue
self.val['max'] = usage self.val['max'] = usage
self.val['name'] = getnamebypid(pid, l[1][1:-1]) self.val['name'] = getnamebypid(pid, l[1][1:-1])
 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)