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'; } 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) . '%' ); echo json_encode($data); exit; } ?>
% memory usage
% hit rate
used memory:
free memory:
wasted memory: (%)
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')); ?> |
Directives | |
---|---|
true' : 'false') : $v); ?> |
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: |