Permalink
Browse files

Fixed dstat_disk plugin for total calculation on 2.6.25+ kernels (Noe…

…l J. Bergman)
  • Loading branch information...
1 parent 18eb9be commit fa9ec97fcb06b75e544e2b374b738d68329c2bd5 @dagwieers committed Dec 15, 2008
Showing with 21 additions and 15 deletions.
  1. +3 −0 ChangeLog
  2. +7 −7 dstat
  3. +4 −1 dstat.spec
  4. +7 −7 dstat15
View
@@ -1,3 +1,6 @@
+* 0.6.9svn - ... - release 15/12/2008
+- Fixed dstat_disk plugin for total calculation on 2.6.25+ kernels (Noel J. Bergman)
+
* 0.6.9 - Locarno - release 02/12/2008
- Input text color is now gray (again)
- Added external dstat_luster plugin (Brock Palen, Kilian Vavalotti)
View
14 dstat
@@ -16,7 +16,7 @@
from __future__ import generators
-VERSION = '0.6.9'
+VERSION = '0.6.9svn'
def inspath(path):
if os.path.isdir(path) and path not in sys.path:
@@ -658,7 +658,7 @@ class dstat_disk(dstat):
varlist = []
blockdevices = [os.path.basename(filename) for filename in glob.glob('/sys/block/*')]
for name in self.discover:
- if re.match('(md[0-9]+|dm-[0-9]+)', name): continue
+ if re.match('(dm-[0-9]+|md[0-9]+|[hs]d[a-z]+[0-9]+)', name): continue
if name not in blockdevices: continue
varlist.append(name)
# if len(varlist) > 2: varlist = varlist[0:2]
@@ -676,7 +676,7 @@ class dstat_disk(dstat):
if l[5] == '0' and l[9] == '0': continue
name = l[2]
if l[3:] == ['0',] * 11: continue
- if not re.match('(md[0-9]+|dm-[0-9]+)', name):
+ if not re.match('(dm-[0-9]+|md[0-9]+|[hs]d[a-z]+[0-9]+)', name):
self.cn2['total'] = ( self.cn2['total'][0] + long(l[5]), self.cn2['total'][1] + long(l[9]) )
if name in self.vars and name != 'total':
self.cn2[name] = ( self.cn2[name][0] + long(l[5]), self.cn2[name][1] + long(l[9]) )
@@ -724,7 +724,7 @@ class dstat_disk24(dstat):
else:
varlist = []
for name in self.discover:
- if not re.match('(md[0-9]+|dm-[0-9]+)', name):
+ if not re.match('(dm-[0-9]+|md[0-9]+|[hs]d[a-z]+[0-9]+)', name):
varlist.append(name)
# if len(varlist) > 2: varlist = varlist[0:2]
varlist.sort()
@@ -739,7 +739,7 @@ class dstat_disk24(dstat):
l = line.split()
if len(l) < 15 or l[0] == 'major' or int(l[1]) % 16 != 0: continue
name = l[3]
- if not re.match('(md[0-9]+|dm-[0-9]+)', name):
+ if not re.match('(dm-[0-9]+|md[0-9]+|[hs]d[a-z]+[0-9]+)', name):
self.cn2['total'] = ( self.cn2['total'][0] + long(l[6]), self.cn2['total'][1] + long(l[10]) )
if name in self.vars:
self.cn2[name] = ( self.cn2[name][0] + long(l[6]), self.cn2[name][1] + long(l[10]) )
@@ -795,7 +795,7 @@ class dstat_disk24old(dstat):
else:
varlist = []
for name in self.discover:
- if not re.match('(md[0-9]+|dm-[0-9]+)', name):
+ if not re.match('(dm-[0-9]+|md[0-9]+|[hs]d[a-z]+[0-9]+)', name):
varlist.append(name)
# if len(varlist) > 2: varlist = varlist[0:2]
varlist.sort()
@@ -817,7 +817,7 @@ class dstat_disk24old(dstat):
l = m.groups()
if len(l) < 4: continue
name = dev(int(l[0]), int(l[1]))
- if not re.match('(md[0-9]+)', name):
+ if not re.match('(dm-[0-9]+|md[0-9]+|[hs]d[a-z]+[0-9]+)', name):
self.cn2['total'] = ( self.cn2['total'][0] + long(l[2]), self.cn2['total'][1] + long(l[3]) )
if name in self.vars and name != 'total':
self.cn2[name] = ( self.cn2[name][0] + long(l[2]), self.cn2[name][1] + long(l[3]) )
View
@@ -9,7 +9,7 @@
Summary: Versatile resource statistics tool
Name: dstat
-Version: 0.6.9
+Version: 0.6.9svn
Release: 1
License: GPL
Group: System Environment/Base
@@ -59,6 +59,9 @@ confusion, less mistakes.
%{_datadir}/dstat/
%changelog
+* Mon Dec 15 2008 Dag Wieers <dag@wieers.com> - 0.6.9svn-1
+- Updated to release 0.6.9svn.
+
* Tue Dec 02 2008 Dag Wieers <dag@wieers.com> - 0.6.9-1
- Updated to release 0.6.9.
View
14 dstat15
@@ -16,7 +16,7 @@
#from __future__ import generators
-VERSION = '0.6.9'
+VERSION = '0.6.9svn'
def inspath(path):
if os.path.isdir(path) and path not in sys.path:
@@ -651,7 +651,7 @@ class dstat_disk(dstat):
else:
varlist = []
for name in self.discover:
- if not re.match('(md[0-9]+|dm-[0-9]+)', name):
+ if not re.match('(dm-[0-9]+|md[0-9]+|[hs]d[a-z]+[0-9]+)', name):
varlist.append(name)
# if len(varlist) > 2: varlist = varlist[0:2]
varlist.sort()
@@ -668,7 +668,7 @@ class dstat_disk(dstat):
if l[5] == '0' and l[9] == '0': continue
name = l[2]
if l[3:] == ['0',] * 11: continue
- if not re.match('(md[0-9]+|dm-[0-9]+)', name):
+ if not re.match('(dm-[0-9]+|md[0-9]+|[hs]d[a-z]+[0-9]+)', name):
self.cn2['total'] = ( self.cn2['total'][0] + long(l[5]), self.cn2['total'][1] + long(l[9]) )
if name in self.vars and name != 'total':
self.cn2[name] = ( self.cn2[name][0] + long(l[5]), self.cn2[name][1] + long(l[9]) )
@@ -717,7 +717,7 @@ class dstat_disk24(dstat):
else:
varlist = []
for name in self.discover:
- if not re.match('(md[0-9]+|dm-[0-9]+)', name):
+ if not re.match('(dm-[0-9]+|md[0-9]+|[hs]d[a-z]+[0-9]+)', name):
varlist.append(name)
# if len(varlist) > 2: varlist = varlist[0:2]
varlist.sort()
@@ -732,7 +732,7 @@ class dstat_disk24(dstat):
l = string.split(line)
if len(l) < 15 or l[0] == 'major' or int(l[1]) % 16 != 0: continue
name = l[3]
- if not re.match('(md[0-9]+|dm-[0-9]+)', name):
+ if not re.match('(dm-[0-9]+|md[0-9]+|[hs]d[a-z]+[0-9]+)', name):
self.cn2['total'] = ( self.cn2['total'][0] + long(l[6]), self.cn2['total'][1] + long(l[10]) )
if name in self.vars:
self.cn2[name] = ( self.cn2[name][0] + long(l[6]), self.cn2[name][1] + long(l[10]) )
@@ -789,7 +789,7 @@ class dstat_disk24old(dstat):
else:
varlist = []
for name in self.discover:
- if not re.match('(md[0-9]+|dm-[0-9]+)', name):
+ if not re.match('(dm-[0-9]+|md[0-9]+|[hs]d[a-z]+[0-9]+)', name):
varlist.append(name)
# if len(varlist) > 2: varlist = varlist[0:2]
varlist.sort()
@@ -811,7 +811,7 @@ class dstat_disk24old(dstat):
l = m.groups()
if len(l) < 4: continue
name = dev(int(l[0]), int(l[1]))
- if not re.match('(md[0-9]+)', name):
+ if not re.match('(dm-[0-9]+|md[0-9]+|[hs]d[a-z]+[0-9]+)', name):
self.cn2['total'] = ( self.cn2['total'][0] + long(l[2]), self.cn2['total'][1] + long(l[3]) )
if name in self.vars and name != 'total':
self.cn2[name] = ( self.cn2[name][0] + long(l[2]), self.cn2[name][1] + long(l[3]) )

0 comments on commit fa9ec97

Please sign in to comment.