mirror of
https://github.com/friendica/friendica
synced 2025-04-23 19:10:13 +00:00
Configurable amount of maximum processes
This commit is contained in:
parent
140225b1a8
commit
b45772ba6e
3 changed files with 36 additions and 16 deletions
|
@ -4,23 +4,24 @@ class dbm {
|
|||
$r = q("SHOW PROCESSLIST");
|
||||
$s = array();
|
||||
|
||||
$processes = 0;
|
||||
$states = array();
|
||||
foreach ($r AS $process) {
|
||||
$state = trim($process["State"]);
|
||||
if (!in_array($state, array("", "init", "statistics")))
|
||||
if (!in_array($state, array("", "init", "statistics"))) {
|
||||
++$states[$state];
|
||||
++$processes;
|
||||
}
|
||||
}
|
||||
// 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));
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue