Skip to content

Commit

Permalink
Memory is not an average anymore
Browse files Browse the repository at this point in the history
  • Loading branch information
danpospisil committed Mar 9, 2016
1 parent 1b49900 commit 544461e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
This is a revised version of [Devlopnet / munin-php-fpm](https://github.com/Devlopnet/munin-php-fpm) with the difference that processes are combined based on their pools. Also there is an average process age graph and a process count graph.
This is a modified version of MorbZ/munin-php-fpm https://github.com/MorbZ/munin-php-fpm

Setup PHP-FPM
-------------
Expand All @@ -7,7 +7,7 @@ This plugin requires PHP CLI.

### Install Plugin
`$ cd /usr/share/munin/plugins/`
`$ [sudo] wget -O php-fpm https://raw.github.com/MorbZ/munin-php-fpm/master/php-fpm.php`
`$ [sudo] wget -O php-fpm https://raw.github.com/danpospisil/munin-php-fpm/master/php-fpm.php`
`$ [sudo] chmod +x php-fpm`

### Setup Graphs
Expand Down
7 changes: 4 additions & 3 deletions php-fpm.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
/**
* @author Devlopnet
* @author MorbZ
* @author danpospisil
* @licence CC
*/

Expand Down Expand Up @@ -60,7 +61,7 @@
// ------------------------------------------------------
$elements = array();
foreach ($groups as $name=>$array) {
$ramMb = $array['memory'] / $array['count'];
$ramMb = $array['memory'];
$label = 'Pool ' . $name;
$elements[$name] = array(
'label' => $label,
Expand All @@ -70,7 +71,7 @@
}
$config = array(
'params' => array(
'graph_title' => 'PHP-FPM Average Process Memory',
'graph_title' => 'PHP-FPM Memory Usage by pools',
'graph_vlabel' => 'MB'
),
'elements' => $elements
Expand Down Expand Up @@ -188,4 +189,4 @@ function timeToSeconds ($time) {
//minutes/seconds
$seconds += $parts[0] * 60 + $parts[1];
return $seconds;
}
}

0 comments on commit 544461e

Please sign in to comment.