mirror of
https://github.com/xen-project/xen.git
synced 2026-10-29 10:40:03 +01:00
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>
This commit is contained in:
1 parent
2c4f501f03
commit
bcdecd7942
1 file changed
+5
-3
@@ -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()
|
||||
|
||||