Skip to content
Browse files

Added external dstat_lustre plugin.

  • Loading branch information...
1 parent 015508b commit 20b5f8a8968ab40200ce251e7614d73e256fe71d @dagwieers committed
Showing with 55 additions and 4 deletions.
  1. +4 −0 ChangeLog
  2. +6 −2 dstat
  3. +4 −1 dstat.spec
  4. +1 −1 dstat15
  5. +40 −0 plugins/dstat_lustre.py
View
4 ChangeLog
@@ -1,3 +1,7 @@
+* 0.6.8svn - ... - release 14/09/2008
+- Input text color is now gray (again)
+- Added external dstat_luster plugin (Brock Palen, Kilian Vavalotti)
+
* 0.6.8 - Buenos Aires - release 12/09/2008
- Added improved tick patch (Kelly Long)
- Show milliseconds in dstat_time when using --debug cfr. dstat_epoch
View
8 dstat
@@ -16,7 +16,7 @@
from __future__ import generators
-VERSION = '0.6.8'
+VERSION = '0.6.8svn'
def inspath(path):
if os.path.isdir(path) and path not in sys.path:
@@ -519,7 +519,8 @@ class dstat_cpu(dstat):
if sum(self.cn2[name]) > sum(self.cn1[name]):
self.val[name][i] = 100.0 * (self.cn2[name][i] - self.cn1[name][i]) / (sum(self.cn2[name]) - sum(self.cn1[name]))
else:
- print >>sys.stderr, "Error: tick problem detected, this should never happen !"
+ self.val[name][i] = 0
+# print >>sys.stderr, "Error: tick problem detected, this should never happen !"
if step == op.delay:
self.cn1.update(self.cn2)
@@ -2078,6 +2079,9 @@ def perform(update):
sys.stdout.write(' '+ansi['redbg']+ansi['white']+'missed '+str(missed+1)+' ticks')
missed = 0
+ ### Additional input in gray
+ sys.stdout.write(ansi['gray'])
+
### Finish the line
if not op.update:
sys.stdout.write('\n')
View
5 dstat.spec
@@ -9,7 +9,7 @@
Summary: Versatile resource statistics tool
Name: dstat
-Version: 0.6.8
+Version: 0.6.8svn
Release: 1
License: GPL
Group: System Environment/Base
@@ -59,6 +59,9 @@ confusion, less mistakes.
%{_datadir}/dstat/
%changelog
+* Sun Aug 17 2008 Dag Wieers <dag@wieers.com> - 0.6.8svn-1
+- Updated to release 0.6.8svn.
+
* Sun Aug 17 2008 Dag Wieers <dag@wieers.com> - 0.6.8-1
- Updated to release 0.6.8.
View
2 dstat15
@@ -16,7 +16,7 @@
#from __future__ import generators
-VERSION = '0.6.8'
+VERSION = '0.6.8svn'
def inspath(path):
if os.path.isdir(path) and path not in sys.path:
View
40 plugins/dstat_lustre.py
@@ -0,0 +1,40 @@
+global string
+import string
+global os
+import os
+
+class dstat_lustre(dstat):
+ def __init__(self):
+ self.name = []
+ self.vars = []
+ if os.path.exists('/proc/fs/lustre/llite'):
+ for mount in os.listdir('/proc/fs/lustre/llite'):
+ self.vars.append(mount)
+ self.name.append(mount[:mount.rfind('-')])
+ self.format = ('f', 5, 1024)
+ self.nick = ('read', 'write')
+ self.init(self.vars, 2)
+ info(1, 'Module dstat_lustre is still experimental.')
+
+ def extract(self):
+ for name in self.vars:
+ f = open('/'.join(['/proc/fs/lustre/llite',name,'stats']))
+ lines = f.readlines()
+ for line in lines:
+ l = line.split()
+ if not l or l[0] != 'read_bytes': continue
+ read = long(l[6])
+ for line in lines:
+ l = line.split()
+ if not l or l[0] != 'write_bytes': continue
+ write = long(l[6])
+ self.cn2[name] = (read, write)
+ self.val[name] = ( (self.cn2[name][0] - self.cn1[name][0]) * 1.0 / tick,\
+ (self.cn2[name][1] - self.cn1[name][1]) * 1.0 / tick )
+ if step == op.delay:
+ self.cn1.update(self.cn2)
+
+# vim:ts=4:sw=4
+# Authors
+# Brock Palen brockp@mlds-networks.com
+# Kilian Vavalotti kilian@stanford.edu

0 comments on commit 20b5f8a

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