aboutsummaryrefslogtreecommitdiffstats
path: root/tools/xenmon
diff options
context:
space:
mode:
authorkaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk>2006-03-06 23:47:14 +0100
committerkaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk>2006-03-06 23:47:14 +0100
commitbcdecd7942f0ee03707c6614f74754e15e2fbac3 (patch)
tree8bafa0cd96ef68c9fb9a3395b2fd1b2589c60014 /tools/xenmon
parent2c4f501f033ebb48dc4c804e56c1bcb6d2c622f5 (diff)
downloadxen-bcdecd7942f0ee03707c6614f74754e15e2fbac3.tar.gz
xen-bcdecd7942f0ee03707c6614f74754e15e2fbac3.tar.bz2
xen-bcdecd7942f0ee03707c6614f74754e15e2fbac3.zip
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>
Diffstat (limited to 'tools/xenmon')
-rw-r--r--tools/xenmon/xenmon.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/tools/xenmon/xenmon.py b/tools/xenmon/xenmon.py
index 4ccdf2f8c3..a95f126a23 100644
--- a/tools/xenmon/xenmon.py
+++ b/tools/xenmon/xenmon.py
@@ -502,6 +502,7 @@ def writelog():
shm = mmap.mmap(shmf.fileno(), QOS_DATA_SIZE)
interval = 0
+ curr = last = time.time()
outfiles = {}
for dom in range(0, NDOMAINS):
outfiles[dom] = Delayed("%s-dom%d.log" % (options.prefix, dom), 'w')
@@ -561,9 +562,10 @@ def writelog():
h1[dom][4],
h1[dom][5][0], h1[dom][5][1]))
outfiles[dom].flush()
-
- interval += options.interval
- time.sleep(1)
+ curr = time.time()
+ interval += (curr - last) * 1000
+ last = curr
+ time.sleep(options.interval / 1000.0)
for dom in range(0, NDOMAINS):
outfiles[dom].close()