WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

Re: [Xen-devel] [patch] xenmon.py: fix sleep duration, reporting of time

To: "Diwaker Gupta" <diwaker.lists@xxxxxxxxx>
Subject: Re: [Xen-devel] [patch] xenmon.py: fix sleep duration, reporting of time intervals
From: Tim Freeman <tfreeman@xxxxxxxxxxx>
Date: Mon, 6 Mar 2006 15:25:27 -0600
Cc: xen-devel@xxxxxxxxxxxxxxxxxxx
Delivery-date: Mon, 06 Mar 2006 21:26:18 +0000
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <891be9410603061311o4b353956y9c99604839531e51@xxxxxxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <891be9410603061311o4b353956y9c99604839531e51@xxxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Thankyou this patch is useful (also, I'm finding XenMon itself is highly
useful).

Tim 

On Mon, 6 Mar 2006 13:11:23 -0800
"Diwaker Gupta" <diwaker.lists@xxxxxxxxx> wrote:

> In log mode (-n option), the timestamp  that Xenmon outputs is in
> increments of the specifid interval (default 1s), not the actual time
> passed. This patch fixes this.
> 
> # HG changeset patch
> # Node ID 7dd31dbf16e75f0f70e0f9c44b2bb2b5fc6eecf1
> # Parent  90c71ea18b50f4a7ee1c9fe03f9563a05befb8a6
> 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@xxxxxxxxxxx>
> 
> diff -r 90c71ea18b50 -r 7dd31dbf16e7 tools/xenmon/xenmon.py
> --- a/tools/xenmon/xenmon.py    Mon Mar  6 19:26:30 2006 +0100
> +++ b/tools/xenmon/xenmon.py    Mon Mar  6 13:02:50 2006 -0800
> @@ -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()
> 
> --
> Web/Blog/Gallery: http://floatingsun.net/blog
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@xxxxxxxxxxxxxxxxxxx
> http://lists.xensource.com/xen-devel
> 

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel

<Prev in Thread] Current Thread [Next in Thread>