Skip to content
Browse files

Updates

  • Loading branch information...
1 parent 5ab738c commit 87c9511542a01c2489ecd179d39c3a1222acdd41 @dagwieers committed Oct 14, 2007
Showing with 5 additions and 4 deletions.
  1. +1 −0 ChangeLog
  2. +4 −4 plugins/dstat_topoom.py
View
1 ChangeLog
@@ -14,6 +14,7 @@
- Added external dstat_mysql_* and dstat_innodb_* plugins
- Added greppipe() and matchpipe() to improve performance on pipe-handling
- Added external dstat_topio and dstat_topbio plugins
+- Added external dstat_topoom plugin to show top out-of-memory score
* 0.6.6 - Unemployed - released 28/04/2007
- Removed SwapCached from the Cached counter (Dbt 418326, Peter Rabbitson)
View
8 plugins/dstat_topoom.py
@@ -8,16 +8,16 @@
class dstat_topoom(dstat):
def __init__(self):
- self.name = 'kill score'
+ self.name = 'out of memory'
self.format = ('s', 20, 34)
- self.nick = ('oom process',)
+ self.nick = ('kill score',)
self.vars = self.nick
self.pid = str(os.getpid())
self.cn1 = {}; self.cn2 = {}; self.val = {}
def check(self):
if not os.access('/proc/1/oom_score', os.R_OK):
- raise Exception, 'Kernel does not support /proc/pid/oom_score interface.'
+ raise Exception, 'Kernel does not support /proc/pid/oom_score, use at least 2.6.20.'
return True
def extract(self):
@@ -92,7 +92,7 @@ def show(self):
if self.val['max'] == 0.0:
return '%-*s' % (self.format[1], '')
else:
- return '%s%-*s%s' % (ansi['default'], self.format[1]-6, self.val['process'][0:self.format[1]-6], cprint(self.val['max'], ('p', 6, 34)))
+ return '%s%-*s%s' % (ansi['default'], self.format[1]-4, self.val['process'][0:self.format[1]-4], cprint(self.val['max'], ('f', 4, 1000)))
def showcsv(self):
return '%s / %d%%' % (self.val['name'], self.val['max'])

0 comments on commit 87c9511

Please sign in to comment.
Something went wrong with that request. Please try again.