Add VM_metrics.start_time, and use this to implement xm uptime through the

Xen-API.

Signed-off-by: Tom Wilkie <tom.wilkie@gmail.com>
This commit is contained in:
Ewan Mellor committed 2007-03-22 16:32:18 +00:00
1 parent 93fdf19076
commit 7af644b697
3 files changed
+12 -3

No files matched your search

+5 -1
View File
@@ -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 = []
@@ -1623,6 +1624,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
# ----------------------------------------------------------------
+5 -1
View File
@@ -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(),
}
+2 -1
View File
@@ -709,7 +709,8 @@ def getDomains(domain_names, state, full = 0):
'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)
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.