[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen-unstable] Add VM_metrics.start_time, and use this to implement xm uptime through the



# 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


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.