]> git.mxchange.org Git - friendica.git/blob - include/dbm.php
Merge remote-tracking branch 'upstream/develop' into 1606-dbm
[friendica.git] / include / dbm.php
1 <?php
2 class dbm {
3         public static function processlist() {
4                 $r = q("SHOW PROCESSLIST");
5                 $s = array();
6
7                 $states = array();
8                 foreach ($r AS $process) {
9                         $state = trim($process["State"]);
10                         if (!in_array($state, array("", "init", "statistics")))
11                                 ++$states[$state];
12                 }
13                 // query end
14                 // Sending data
15                 // updating
16
17                 $statelist = "";
18                 foreach ($states AS $state => $usage) {
19                         if ($statelist != "")
20                                 $statelist .= ", ";
21                         $statelist .= $state.": ".$usage;
22                 }
23                 return($statelist);
24         }
25 }
26 ?>