Permalink
Browse files

Added improved tick patch (Kelly Long)

  • Loading branch information...
dagwieers committed Mar 9, 2008
1 parent ddac842 commit ce014a91b0d41f48ec46b118159d8f46d35db29a
Showing with 27 additions and 15 deletions.
  1. +7 −3 ChangeLog
  2. +6 −6 TODO
  3. +12 −4 dstat
  4. +1 −1 plugins/dstat_topbio.py
  5. +1 −1 plugins/dstat_topio.py
View
@@ -1,3 +1,7 @@
+* 0.6.7svn - ... - release 09/03/2008
+- Added improved tick patch (Kelly Long)
+- Show milliseconds in dstat_time when using --debug cfr. dstat_epoch
+
* 0.6.7 - Cambridge overdue - released 26/02/2008
- Only rewrite xterm title when XTERM_SHELL is set to bash
- Added more Dbt (Debian bug tracker) ids in the ChangeLog and TODO
@@ -8,9 +12,9 @@
- Fixed a problem with asciidoc DocBook output (Dbt 427214, Michael Ablassmeier)
- Report when python-curses is missing and colors don't work (eg. on OpenSUSE)
- Improve --version output wrt. terminal and color support
-- Fixed a few inaccuracies in the man page. (John Goggan)
-- Fixed opening vanished files in /proc in dstat_topcpu.
-- Fixed formatting bug in dstat_topcpu.
+- Fixed a few inaccuracies in the man page (John Goggan)
+- Fixed opening vanished files in /proc in dstat_topcpu
+- Fixed formatting bug in dstat_topcpu
- 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
View
12 TODO
@@ -57,7 +57,7 @@ contact me as well. :) Send an email to: Dag Wieers <dag@wieers.com>
+ Python 1.5 prints 'L' for long, crashes when int()
+ Implement better (?) protection against counter rollovers (see mail from Sebastien Prud'homme)
+ Plugins currently have to be written in python 1.5 to work for dstat15 (lowest common denominator)
-+ When stdout is suspend (Ctrl-S) you get: IOError: [Errno 4] Interrupted system call (Dbt 309953, Marc Lehmann, supastuff@freenode)
++ Because output is unbiffered, when stdout is suspendes (Ctrl-S) you get: IOError: [Errno 4] Interrupted system call (Dbt 309953, Marc Lehmann, supastuff@freenode)
### Plugin issues
+ plugins that use /proc/pid are reasonably slow
@@ -72,12 +72,12 @@ contact me as well. :) Send an email to: Dag Wieers <dag@wieers.com>
+ Create modules that can contain samples of different units
CPU: (see mpstat)
- sys, usr, idl, iow, hiq, siq (percentage)
- intr/sec (int)
-
+ sys, usr, idl, iow, hiq, siq (percentage)
+ intr/sec (int)
+
IO: (see iostat -x)
- tps (int)
- blk_read/sec, blk_wrtn/sec (kB/sec)
+ tps (int)
+ blk_read/sec, blk_wrtn/sec (kB/sec)
+ Design proper object model and namespace for _all_ possible stats
+ Create a seperate curses-based tool, much like nmon (dstat stays line-based)
View
16 dstat
@@ -1276,13 +1276,16 @@ class dstat_time(dstat):
def __init__(self):
self.name = 'time'
self.format = ('s', 14, 0)
+ if op.debug:
+ self.format = ('s', 18, 0)
self.nick = ('date/time',)
self.vars = ('time',)
self.init(self.vars, 1)
def extract(self):
- ### FIXME: Add milliseconds when using --debug (see dstat_epoch)
self.val['time'] = time.strftime('%d-%m %H:%M:%S', time.localtime())
+ if op.debug:
+ self.val['time'] = time.strftime('%d-%m %H:%M:%S', time.localtime()) + ".%d" % (time.time() * 1000 % 1000 )
def show(self):
if step == op.delay:
@@ -1954,7 +1957,7 @@ def main():
if newwidth <= cols or ( vislist == totlist[:-1] and newwidth < cols ):
vislist.append(o)
curwidth = newwidth
-
+
### Check when to display the header
if op.header and rows >= 6:
if oldvislist != vislist:
@@ -1980,6 +1983,13 @@ def main():
ansi['default'] = ansi['gray']
line = ansi['default']
+ ### Recalculate the time spend
+ ticknow = time.time()
+ if loop != 0:
+ tick = ticknow - tickbefore
+ if step == op.delay:
+ tickbefore = ticknow
+
### Calculate all objects (visible, invisible)
oline = ''
for o in totlist:
@@ -1988,7 +1998,6 @@ def main():
line = line + o.show() + o.showend(totlist, vislist)
if op.output and step == op.delay:
oline = oline + o.showcsv() + o.showcsvend(totlist, vislist)
-
### Print stats
sys.stdout.write(line + ansi['default'])
if op.output and step == op.delay:
@@ -2029,7 +2038,6 @@ def main():
loop = (update + op.delay - 1) / op.delay
step = ((update - 1) % op.delay) + 1
- tick = step
signal.signal(signal.SIGALRM, signal.SIG_IGN)
View
@@ -17,7 +17,7 @@ def __init__(self):
def check(self):
if not os.access('/proc/self/io', os.R_OK):
- raise Exception, 'Kernel has no I/O accounting, use at least 2.6.20.'
+ raise Exception, 'Kernel has no I/O accounting, use at least 2.6.20'
return True
def extract(self):
View
@@ -17,7 +17,7 @@ def __init__(self):
def check(self):
if not os.access('/proc/self/io', os.R_OK):
- raise Exception, 'Kernel has no I/O accounting, use at least 2.6.20.'
+ raise Exception, 'Kernel has no I/O accounting, use at least 2.6.20'
return True
def extract(self):

0 comments on commit ce014a9

Please sign in to comment.