]>
jfr.im git - irc/unrealircd/unrealircd-webpanel.git/blob - api/data.php
4 if (!isset($_SESSION['id']))
7 $cpuUsage = sys_getloadavg();
9 function convert($size)
11 $unit=array('b','kb','mb','gb','tb','pb');
12 return @round($size/pow(1024,($i=floor(log($size,1024)))),2).$unit[$i];
15 $memUsage = memory_get_usage(true);
17 "cpu" => $cpuUsage[0],
18 "memory" => convert($memUsage),
21 header('Content-Type: application/json');
22 echo json_encode($data);