ia64/xen-unstable

changeset 9177:0ad422291688

Fix reporting of time intervals in the log mode of XenMon.
Fix duration to sleep between iterations (earlier hardcoded to 1sec)
Signed-off-by: Diwaker Gupta <dgupta@cs.ucsd.edu>
author kaf24@firebug.cl.cam.ac.uk
date Mon Mar 06 23:47:14 2006 +0100 (2006-03-06)
parents d60392d5b818
children b0d8b38681ff
files tools/xenmon/xenmon.py
line diff
     1.1 --- a/tools/xenmon/xenmon.py	Mon Mar 06 20:29:39 2006 +0100
     1.2 +++ b/tools/xenmon/xenmon.py	Mon Mar 06 23:47:14 2006 +0100
     1.3 @@ -502,6 +502,7 @@ def writelog():
     1.4      shm = mmap.mmap(shmf.fileno(), QOS_DATA_SIZE)
     1.5  
     1.6      interval = 0
     1.7 +    curr = last = time.time()
     1.8      outfiles = {}
     1.9      for dom in range(0, NDOMAINS):
    1.10          outfiles[dom] = Delayed("%s-dom%d.log" % (options.prefix, dom), 'w')
    1.11 @@ -561,9 +562,10 @@ def writelog():
    1.12                                       h1[dom][4], 
    1.13                                       h1[dom][5][0], h1[dom][5][1]))
    1.14                      outfiles[dom].flush()
    1.15 -
    1.16 -        interval += options.interval
    1.17 -        time.sleep(1)
    1.18 +            curr = time.time()
    1.19 +            interval += (curr - last) * 1000
    1.20 +            last = curr
    1.21 +        time.sleep(options.interval / 1000.0)
    1.22  
    1.23      for dom in range(0, NDOMAINS):
    1.24          outfiles[dom].close()