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

Re: [Xen-devel] [PATCH] tools/python: expose xc_getcpuinfo()



On Tue, 2014-05-13 at 16:32 -0400, Zhigang Wang wrote:
> This API can be used to get per physical CPU utilization.
> 
> Testing:
> 
>       # python
>       >>> import xen.lowlevel.xc
>       >>> xc = xen.lowlevel.xc.xc()
>       >>> xc.getcpuinfo()
>       Traceback (most recent call last):
>         File "<stdin>", line 1, in <module>
>       TypeError: Required argument 'max_cpus' (pos 1) not found
>       >>> xc.getcpuinfo(4)
>       [{'idletime': 109322086128854}, {'idletime': 109336447648802},
>       {'idletime': 109069270544960}, {'idletime': 109065612611363}]
>       >>> xc.getcpuinfo(100)
>       [{'idletime': 109639015806078}, {'idletime': 109654551195681},
>       {'idletime': 109382107891193}, {'idletime': 109382057541119}]
>       >>> xc.getcpuinfo(1)
>       [{'idletime': 109682068418798}]
>       >>> xc.getcpuinfo(2)
>       [{'idletime': 109711311201330}, {'idletime': 109728458214729}]
>       >>> xc.getcpuinfo(max_cpus=4)
>       [{'idletime': 109747116214638}, {'idletime': 109764982453261},
>       {'idletime': 109491373228931}, {'idletime': 109489858724432}]
> 
> Signed-off-by: Zhigang Wang <zhigang.x.wang@xxxxxxxxxx>

Acked + applied, thanks.



_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

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