API Get Performance Stats

From Virtualizor Wiki
Jump to: navigation, search

Get Performance Stats

Example Code

<?php

    require_once('admin.php');

    $key =  'uketenhrhpunty5lhgwkcuxxxxxxxxxx';

    $pass = 'yrsofc3tg3tre7bjpfppspxxxxxxxxxx';

    $ip = 'xxx.xxx.xxx.xxx';

    $admin = new Virtualizor_Admin_API($ip, $key, $pass);

    $output = $admin->performance();
    print_r($output);
?>

Returns:

Array
(
    [title] => Performance
    [perfomance] => Array
        (
            [cpu] => 22.83
            [ram] => 65.04
        )

    [timenow] => 1403243789
    [time_taken] => 0.222
)