friendica_2021-01/include/dbm.php
2016-06-03 23:10:23 +02:00

29 lines
583 B
PHP

<?php
class dbm {
public static function processlist() {
$r = q("SHOW PROCESSLIST");
$s = array();
$states = array();
foreach ($r AS $process) {
$state = trim($process["State"]);
if (!in_array($state, array("", "init", "statistics")))
++$states[$state];
}
// query end
// Sending data
// updating
$statelist = "";
$processes = 0;
foreach ($states AS $state => $usage) {
if ($statelist != "")
$statelist .= ", ";
$statelist .= $state.": ".$usage;
++$processes;
}
return(array("list" => $statelist, "amount" => $processes));
}
}
?>