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-changelog

[Xen-changelog] [xen-unstable] [XEND] Cleanup old domains in statistics

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] [XEND] Cleanup old domains in statistics monitor.
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Thu, 25 Jan 2007 08:55:30 -0800
Delivery-date: Thu, 25 Jan 2007 09:50:14 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User Alastair Tse <atse@xxxxxxxxxxxxx>
# Date 1169653858 0
# Node ID e4d415692ba5994b20a6833bbc609c69975beffc
# Parent  f000f963bbfdb27c4f289227d0183cb00bab6672
[XEND] Cleanup old domains in statistics monitor.

Signed-off-by: Alastair Tse <atse@xxxxxxxxxxxxx>
---
 tools/python/xen/xend/XendMonitor.py |   16 +++++++++++++++-
 1 files changed, 15 insertions(+), 1 deletion(-)

diff -r f000f963bbfd -r e4d415692ba5 tools/python/xen/xend/XendMonitor.py
--- a/tools/python/xen/xend/XendMonitor.py      Wed Jan 24 15:50:02 2007 +0000
+++ b/tools/python/xen/xend/XendMonitor.py      Wed Jan 24 15:50:58 2007 +0000
@@ -220,10 +220,11 @@ class XendMonitor(threading.Thread):
         while True:
             self.lock.acquire()
             try:
-            
+                active_domids = set()
                 # Calculate utilisation for VCPUs
                 
                 for domid, cputimes in self._get_cpu_stats().items():
+                    active_domids.add(domid)
                     if domid not in self._domain_vcpus:
                         # if not initialised, save current stats
                         # and skip utilisation calculation
@@ -310,6 +311,19 @@ class XendMonitor(threading.Thread):
                     self.pifs_util[pifid] = (rx_util, tx_util)
                     self.pifs[pifid] = stats
 
+                for domid in self.domain_vcpus_util.keys():
+                    if domid not in active_domids:
+                        del self.domain_vcpus_util[domid]
+                        del self.domain_vcpus[domid]
+                for domid in self.domain_vifs_util.keys():
+                    if domid not in active_domids:
+                        del self.domain_vifs_util[domid]
+                        del self.domain_vifs[domid]
+                for domid in self.domain_vbds_util.keys():
+                    if domid not in active_domids:
+                        del self.domain_vbds_util[domid]
+                        del self.domain_vbds[domid]
+
             finally:
                 self.lock.release()
 

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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-unstable] [XEND] Cleanup old domains in statistics monitor., Xen patchbot-unstable <=