diff options
author | jim-p <jimp@pfsense.org> | 2013-07-16 15:38:24 -0400 |
---|---|---|
committer | jim-p <jimp@pfsense.org> | 2013-07-16 15:39:19 -0400 |
commit | 4a83831c53dd61e9fb94dea2f1bd7ee73210b252 (patch) | |
tree | 667b01bfe9aee294b4b33bcf0516e8e1d6fce743 /usr/local/www/includes | |
parent | 2c7f71d97e6dfb3278c849ad5f16754a24086fa7 (diff) | |
download | pfsense-4a83831c53dd61e9fb94dea2f1bd7ee73210b252.zip pfsense-4a83831c53dd61e9fb94dea2f1bd7ee73210b252.tar.gz |
Add a meter for states, too
Diffstat (limited to 'usr/local/www/includes')
-rw-r--r-- | usr/local/www/includes/functions.inc.php | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/usr/local/www/includes/functions.inc.php b/usr/local/www/includes/functions.inc.php index 3e00d13..359887c 100644 --- a/usr/local/www/includes/functions.inc.php +++ b/usr/local/www/includes/functions.inc.php @@ -22,6 +22,7 @@ function get_stats() { $stats['cpufreq'] = get_cpufreq(); $stats['load_average'] = get_load_average(); $stats['mbuf'] = get_mbuf(); + $stats['statepercent'] = get_pfstate(true); $stats = join("|", $stats); return $stats; } @@ -138,7 +139,7 @@ function cpu_usage() { return $cpuUsage; } -function get_pfstate() { +function get_pfstate($percent=false) { global $config; $matches = ""; if (isset($config['system']['maximumstates']) and $config['system']['maximumstates'] > 0) @@ -149,7 +150,10 @@ function get_pfstate() { if (preg_match("/([0-9]+)/", $curentries, $matches)) { $curentries = $matches[1]; } - return $curentries . "/" . $maxstates; + if ($percent) + return ($curentries / $maxstates) * 100; + else + return $curentries . "/" . $maxstates; } function has_temp() { |