Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Added listing of available modules.

  • Loading branch information...
commit 0d667d991e83c9cabad5390ff3027d0fc5c81f70 1 parent b25d4cb
@dagwieers authored
Showing with 53 additions and 15 deletions.
  1. +4 −0 ChangeLog
  2. +1 −0  TODO
  3. +31 −7 dstat
  4. +9 −4 dstat.1
  5. +4 −1 dstat.spec
  6. +4 −3 dstat15
View
4 ChangeLog
@@ -1,3 +1,7 @@
+* 0.6.1 - Fishkill - released ??/??/2005
+- Look for plugins in ~/.dstat/ too
+- Added -M list to show the list of available modules per path
+
* 0.6.0 - Bettiesbaai - released 29/05/2005
- Removed keyboard input prevention patch. (Dbt 304673, Marc Lehmann)
- Fixed bug with: dstat -tit -I 177
View
1  TODO
@@ -20,6 +20,7 @@
+ Look at /proc/fs/cifs/stats
+ Look at /proc/net/rpc/nfsd and /proc/net/rpc/nfs
+ Allow for SNMP counters to be added
++ Add LVM stats
### Documentation (help welcome!)
+ Improve manpage
View
38 dstat
@@ -19,10 +19,12 @@ from __future__ import generators
try:
import sys, signal, os, re, time
import types, signal, resource
- pwd = os.path.dirname(sys.argv[0])
- sys.path.insert(0, '/usr/share/dstat/')
- sys.path.insert(0, pwd + '/plugins/')
- sys.path.insert(0, pwd)
+ cwd = os.path.abspath(os.path.dirname(sys.argv[0]))
+ sys.path.insert(0, os.getenv('HOME') + '/.dstat/')
+ if cwd in sys.path: sys.path.remove(cwd)
+ sys.path.insert(1, cwd)
+ sys.path.insert(2, cwd + '/plugins/')
+ sys.path.insert(3, '/usr/share/dstat/')
except KeyboardInterrupt, e:
pass
@@ -61,7 +63,7 @@ except NameError:
True = 1
False = 0
-VERSION = '0.6.0'
+VERSION = '0.6.1'
class Options:
def __init__(self, args):
@@ -1543,8 +1545,29 @@ def exit(ret):
# termios.tcsetattr(fd, termios.TCSADRAIN, old)
sys.exit(ret)
+def listmodules():
+ import glob
+ global cols
+ remod = re.compile('.+/dstat_(.+).py$')
+ for path in sys.path:
+ list = []
+ for file in glob.glob(path + '/dstat_*.py'):
+ list.append(remod.match(file).groups()[0])
+ if not list: continue
+ list.sort()
+ cols2 = cols - 8
+ print '%s:\n\t' % os.path.abspath(path),
+ for mod in list:
+ cols2 = cols2 - len(mod) - 2
+ if cols2 <= 0:
+ print '\n\t',
+ cols2 = cols - len(mod) - 10
+ print mod + ',',
+ print
+ exit(0)
+
def main():
- global update, loop, step, pagesize, cpunr, ansi, interval, outputfile, tick
+ global update, loop, step, pagesize, cpunr, ansi, interval, outputfile, tick, cols
loop = update = 0
step = op.delay
@@ -1593,7 +1616,8 @@ def main():
oldvislist = []
totlist = []
for module in op.modlist:
- if module == 'cpu': mods = ( 'cpu', 'cpu24' )
+ if module == 'list' or module == 'help': listmodules()
+ elif module == 'cpu': mods = ( 'cpu', 'cpu24' )
elif module == 'disk': mods = ( 'disk', 'disk24', 'disk24old' )
elif module == 'int': mods = ( 'int', 'int24' )
elif module == 'page': mods = ( 'page', 'page24' )
View
13 dstat.1
@@ -95,7 +95,8 @@ Possible internal stats are:
cpu, disk, int, ipc, load, lock, mem, net, page,
proc, raw, swap, sys, tcp, time, udp, unix
-Also see /usr/share/dstat/ for external stats
+Possible external stats can be listed using:
+ dstat -M list
.TP
\fB\-a\fR, \fB\-\-all\fR
equals \fB\-cdngy\fR (default)
@@ -131,15 +132,19 @@ The default delay is 1 and count is unspecified (unlimited)
.SH INTERMEDIATE UPDATES
When invoking dstat with a \fBdelay\fR greater than 1 and without the \fB--noupdate\fR option, it will show intermediate updates, ie. the first time a 1 sec average, the second update a 2 second average, etc. until the delay has been reached.
-\fBSo the 9 intermediate updates are NOT snapshots\fR, they are averages over the time that passed since the last final update. The end result is that you get a 10 second average on a new line, just like vmstat.
+So in case you specified a delay of 10, \fBthe 9 intermediate updates are NOT snapshots\fR, they are averages over the time that passed since the last final update. The end result is that you get a 10 second average on a new line, just like with vmstat.
.SH BUGS
-Since it's practically impossible to test dstat on every possible permutation of kernel , python or distribution version, I need your help and your feedback to fix the remaining problems. If you have improvements or bugreports, please send them to: dag@wieers.com
+Since it's practically impossible to test dstat on every possible permutation of kernel , python or distribution version, I need your help and your feedback to fix the remaining problems. If you have improvements or bugreports, please send them to: \fBdag@wieers.com\fR
Please see the TODO file for known bugs and future plans.
.SH FILES
-/usr/share/dstat/, contains extra external stats
+.SS ~/.dstat/
+.SS ./
+.SS ./plugins/
+.SS /usr/share/dstat/
+paths that may contain external dstat_* modules
.SH SEE ALSO
.SS Performance tools
View
5 dstat.spec
@@ -9,7 +9,7 @@
Summary: Versatile resource statistics tool
Name: dstat
-Version: 0.6.0
+Version: 0.6.1
Release: 1
License: GPL
Group: System Environment/Base
@@ -76,6 +76,9 @@ to generate graphs.
%{_datadir}/dstat/
%changelog
+* Tue May 31 2005 Dag Wieers <dag@wieers.com> - 0.6.1-1
+- Updated to release 0.6.1.
+
* Sun May 29 2005 Dag Wieers <dag@wieers.com> - 0.6.0-1
- Updated to release 0.6.0.
View
7 dstat15
@@ -20,9 +20,10 @@ try:
import sys, signal, os, re, time, string
import types, signal, resource
pwd = os.path.dirname(sys.argv[0])
- sys.path.insert(0, '/usr/share/dstat/')
- sys.path.insert(0, pwd + '/plugins/')
- sys.path.insert(0, pwd)
+ sys.path.insert(0, os.getenv('HOME') + '/.dstat/')
+ sys.path.insert(1, pwd)
+ sys.path.insert(2, pwd + '/plugins/')
+ sys.path.insert(3, '/usr/share/dstat/')
except KeyboardInterrupt, e:
pass
Please sign in to comment.
Something went wrong with that request. Please try again.