2 ); $opcache_config = opcache_get_configuration(); $opcache_status = opcache_get_status(); uasort($opcache_status['scripts'], function($a, $b) { return $a['hits'] < $b['hits']; }); function memsize($size, $precision = 3, $space = false) { $i = 0; $val = array(' bytes', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'); while (($size / 1024) > 1) { $size /= 1024; ++$i; } return sprintf("%.{$precision}f%s%s", $size, (($space && $i) ? ' ' : ''), $val[$i]); } function rc($at = null) { static $i = 0; if ($at !== null) { $i = $at; } else { echo (++$i % 2 ? 'odd' : 'even'); } } $highlightValueMemoryUsage = round(100 * ($opcache_status['memory_usage']['used_memory'] / $opcache_status['memory_usage']['free_memory'])); $highlightValueHits = round($opcache_status['opcache_statistics']['opcache_hit_rate']); $threshold = ''; if ($highlightValueMemoryUsage >= 80) { $threshold = ' high'; } elseif ($threshold >= 60) { $threshold = ' mid'; } $totalFilesCached = count($opcache_status['scripts']); if (!empty($_SERVER['HTTP_X_REQUESTED_WITH']) && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest' ) { $data = array( 'memory_usage' => "{$highlightValueMemoryUsage}%", 'hit_rate' => "{$highlightValueHits}%", 'used_memory' => memsize($opcache_status['memory_usage']['used_memory']), 'free_memory' => memsize($opcache_status['memory_usage']['free_memory']), 'wasted_memory' => memsize($opcache_status['memory_usage']['wasted_memory']), 'wasted_percentage' => round($opcache_status['memory_usage']['current_wasted_percentage'], 2) . '%', 'files_cached' => $totalFilesCached ); echo json_encode($data); exit; } $host = (function_exists('gethostname') ? gethostname() : (php_uname('n') ?: (empty($_SERVER['SERVER_NAME']) ? $_SERVER['HOST_NAME'] : $_SERVER['SERVER_NAME'] ) ) ); $validPages = array('overview', 'files'); $page = (empty($_GET['page']) || !in_array($_GET['page'], $validPages) ? 'overview' : $_GET['page'] ); ?>

Overview File usage

Overview

% memory usage

% hit rate

used memory:

free memory:

wasted memory: (%)

number of cached files:


Enable real-time update of stats

General info
Zend OPcache
PHP
Host
Server Software
Start time
Last reset never' : date_format(date_create("@{$opcache_status['opcache_statistics']['last_restart_time']}"), 'Y-m-d H:i:s')); ?>
$v): ?>
Directives
true' : 'false') : $v); ?>

File usage

file cached

Script Details
'; echo join(DIRECTORY_SEPARATOR, array_slice($parts, $settings['compress_path_threshold'])); if (count($parts) > $settings['compress_path_threshold']) { echo DIRECTORY_SEPARATOR; } echo "{$base}"; } else { echo htmlentities($s['full_path'], ENT_COMPAT, 'UTF-8'); } ?>

hits: , memory:
last used: