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:
kaf24@firebug.cl.cam.ac.uk committed 2006-03-06 23:47:14 +01:00
1 parent 2c4f501f03
commit bcdecd7942
1 file changed
+5 -3
+5 -3
View File
@@ -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()
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.