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] Add VM_metrics.start_time, and use this t

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] Add VM_metrics.start_time, and use this to implement xm uptime through the
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Thu, 22 Mar 2007 14:10:11 -0700
Delivery-date: Thu, 22 Mar 2007 14:09:20 -0700
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 Ewan Mellor <ewan@xxxxxxxxxxxxx>
# Date 1174581138 0
# Node ID 5f526fcc8e58dc41066e542b1f1a18e4a4307bb7
# Parent  4baae9f9fdbbe6fbed1362f5601c9ffa65135c8b
Add VM_metrics.start_time, and use this to implement xm uptime through the
Xen-API.

Signed-off-by: Tom Wilkie <tom.wilkie@xxxxxxxxx>
---
 tools/python/xen/xend/XendAPI.py       |    6 +++++-
 tools/python/xen/xend/XendVMMetrics.py |    6 +++++-
 tools/python/xen/xm/main.py            |    3 ++-
 3 files changed, 12 insertions(+), 3 deletions(-)

diff -r 4baae9f9fdbb -r 5f526fcc8e58 tools/python/xen/xend/XendAPI.py
--- a/tools/python/xen/xend/XendAPI.py  Thu Mar 22 14:31:03 2007 +0000
+++ b/tools/python/xen/xend/XendAPI.py  Thu Mar 22 16:32:18 2007 +0000
@@ -1592,7 +1592,8 @@ class XendAPI(object):
                           'VCPUs_utilisation',
                           'VCPUs_CPU',
                           'VCPUs_flags',
-                          'VCPUs_params']
+                          'VCPUs_params',
+                          'start_time']
     VM_metrics_attr_rw = []
     VM_metrics_methods = []
 
@@ -1622,6 +1623,9 @@ class XendAPI(object):
 
     def VM_metrics_get_VCPUs_params(self, _, ref):
         return xen_api_success(self._VM_metrics_get(ref).get_VCPUs_params())
+
+    def VM_metrics_get_start_time(self, _, ref):
+        return xen_api_success(self._VM_metrics_get(ref).get_start_time())
 
 
     # Xen API: Class VBD
diff -r 4baae9f9fdbb -r 5f526fcc8e58 tools/python/xen/xend/XendVMMetrics.py
--- a/tools/python/xen/xend/XendVMMetrics.py    Thu Mar 22 14:31:03 2007 +0000
+++ b/tools/python/xen/xend/XendVMMetrics.py    Thu Mar 22 16:32:18 2007 +0000
@@ -113,6 +113,9 @@ class XendVMMetrics:
         else:
             return {}
 
+    def get_start_time(self):
+        return self.xend_domain_instance.info.get("start_time", -1)
+    
     def get_record(self):
         return { 'uuid'              : self.uuid,
                  'memory_actual'     : self.get_memory_actual(),
@@ -120,5 +123,6 @@ class XendVMMetrics:
                  'VCPUs_utilisation' : self.get_VCPUs_utilisation(),
                  'VCPUs_CPU'         : self.get_VCPUs_CPU(),
                  'VCPUs_flags'       : self.get_VCPUs_flags(),
-                 'VCPUs_params'      : self.get_VCPUs_params()
+                 'VCPUs_params'      : self.get_VCPUs_params(),
+                 'start_time'        : self.get_start_time(),
                }
diff -r 4baae9f9fdbb -r 5f526fcc8e58 tools/python/xen/xm/main.py
--- a/tools/python/xen/xm/main.py       Thu Mar 22 14:31:03 2007 +0000
+++ b/tools/python/xen/xm/main.py       Thu Mar 22 16:32:18 2007 +0000
@@ -709,7 +709,8 @@ def getDomains(domain_names, state, full
                             'memory_actual': 
int(dom_metrics['memory_actual'])/1024,
                             'vcpus':    dom_metrics['VCPUs_number'],
                             'state':    '-----',
-                            'cpu_time': dom_metrics['VCPUs_utilisation']})
+                            'cpu_time': dom_metrics['VCPUs_utilisation'],
+                            'start_time': dom_metrics['start_time']})
                        
             doms_sxp.append(['domain'] + map2sxp(dom_rec))
             doms_dict.append(dom_rec)

_______________________________________________
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] Add VM_metrics.start_time, and use this to implement xm uptime through the, Xen patchbot-unstable <=