From cbf639afee2402e191f3108ba6d11d70f392591e Mon Sep 17 00:00:00 2001 From: Andrew Collington Date: Wed, 29 May 2013 12:47:15 +0100 Subject: [PATCH] Fixed total memory usage and set page to reload after cache is reset. --- index.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/index.php b/index.php index 9e7bd34..06e91ee 100644 --- a/index.php +++ b/index.php @@ -17,7 +17,7 @@ $page = (empty($_GET['page']) || !in_array($_GET['page'], $validPages) if ($page == 'reset') { opcache_reset(); - $page = 'overview'; + header('Location: ?page=overview'); } $opcache_config = opcache_get_configuration(); @@ -55,7 +55,10 @@ $data = array_merge( $opcache_status['memory_usage'], $opcache_status['opcache_statistics'], array( - 'used_memory_percentage' => round(100 * ($opcache_status['memory_usage']['used_memory'] / $opcache_status['memory_usage']['free_memory'])), + 'total_memory_size' => memsize($opcache_config['directives']['opcache.memory_consumption']), + 'used_memory_percentage' => round(100 * ( + ($opcache_status['memory_usage']['used_memory'] + $opcache_status['memory_usage']['wasted_memory']) + / $opcache_config['directives']['opcache.memory_consumption'])), 'hit_rate_percentage' => round($opcache_status['opcache_statistics']['opcache_hit_rate']), 'wasted_percentage' => round($opcache_status['memory_usage']['current_wasted_percentage'], 2), 'used_memory_size' => memsize($opcache_status['memory_usage']['used_memory']), @@ -160,6 +163,7 @@ $host = (function_exists('gethostname') border: 1px solid #a1a1a1; text-shadow: 0px -1px 0px rgba(000,000,000,0), 0px 1px 0px rgba(255,255,255,0.4); margin: 0 1em; + white-space: nowrap; } span.showmore span.button:hover { background-color: #CCCCCC; @@ -236,6 +240,7 @@ $host = (function_exists('gethostname')

%
hit rate

+

total memory:

used memory:

free memory:

wasted memory: (%)