Commit 2166e81f authored by mh's avatar mh
Browse files

initialize all pools from the sockets in /run

parent d47377f9
......@@ -8,10 +8,26 @@
* @licence CC
*/
exec("cd /tmp && find /run/fpm* -type s", $sockets);
$pools = preg_replace('/^\/run\/fpm\-(.*)-socket\/(\d+)\.socket$/','${1}-${2}',$sockets);
$groups = array();
foreach ($pools as $pool) {
$poolName = str_replace('.', '_', $pool);
if (!isset($groups[$poolName])) {
$groups[$poolName] = array(
'count' => 0,
'memory' => 0,
'cpu' => 0,
'time' => 0
);
}
}
exec("ps -eo %cpu,etime,rss,command | grep php-fpm", $result);
//iterate through processes
$groups = array();
foreach ($result as $line) {
//split fields
$line = trim($line);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment