diff options
author | Alastair Tse <atse@xensource.com> | 2007-01-24 12:09:41 +0000 |
---|---|---|
committer | Alastair Tse <atse@xensource.com> | 2007-01-24 12:09:41 +0000 |
commit | a19ccaa253cc8c16ddf2cbd545faebee00ece324 (patch) | |
tree | c553f438e188875cd72d51efbd4bbc353b5a87f7 /tools/python/scripts | |
parent | e8d1d260310f7700a5c4200ca299b533aa84be9f (diff) | |
download | xen-a19ccaa253cc8c16ddf2cbd545faebee00ece324.tar.gz xen-a19ccaa253cc8c16ddf2cbd545faebee00ece324.tar.bz2 xen-a19ccaa253cc8c16ddf2cbd545faebee00ece324.zip |
[XEND] Add simple VCPUs, VBDs, VIFs statistics monitoring
Keep track of xentop like statistics to expose through the Xen API
Signed-off-by: Alastair Tse <atse@xensource.com>
Diffstat (limited to 'tools/python/scripts')
-rw-r--r-- | tools/python/scripts/xapi.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/tools/python/scripts/xapi.py b/tools/python/scripts/xapi.py index 9bc3b507b8..133bbfd12d 100644 --- a/tools/python/scripts/xapi.py +++ b/tools/python/scripts/xapi.py @@ -200,6 +200,12 @@ def xapi_host_info(*args): print HOST_INFO_FORMAT % ('VMs', len(hostinfo['resident_VMs'])) print HOST_INFO_FORMAT % ('UUID', host) + for host_cpu_uuid in hostinfo['host_CPUs']: + host_cpu = execute(server.host_cpu.get_record, session, + host_cpu_uuid) + print 'CPU %s Util: %.2f' % (host_cpu['number'], + float(host_cpu['utilisation'])) + def xapi_host_set_name(*args): if len(args) < 1: raise OptionError("No hostname specified") |