Hosts/VM resources via PHP API

x86

New Member
Aug 19, 2014
21
0
1
Hello,

Here is another question about fetching resources information about a host (node) or VM via the PHP API.
i.e. when using the API call '/nodes/NODE1/status' you'll get the data back. Except the CPU and I/O delay are a bit different.
They'll return as:
array(12) {
["cpu"]=>
float(0.1659904843661)

But actually the CPU usage is different on the web gui. Any ideas?
Thanks.
 
We use the following JS code to render the cpu value:

Code:
    var render_cpu = function(value) {
        var per = value * 100;
        return per.toFixed(2) + "%";
    };