summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitry Stogov <dmitry@zend.com>2013-03-19 10:17:44 +0400
committerDmitry Stogov <dmitry@zend.com>2013-03-19 10:17:44 +0400
commit840c0d6091ccf25780b97178acd51e2627cefc9a (patch)
tree1f069cdfa4d34f21b3068d36d29aff92ae36e090
parent5b0879e7c969e0bd87b0ad6fad03e278a0a46642 (diff)
downloadphp-git-840c0d6091ccf25780b97178acd51e2627cefc9a.tar.gz
Add stats to phpinfo
-rw-r--r--ext/opcache/zend_accelerator_module.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/ext/opcache/zend_accelerator_module.c b/ext/opcache/zend_accelerator_module.c
index dd8eb5987f..6f72dd9ebc 100644
--- a/ext/opcache/zend_accelerator_module.c
+++ b/ext/opcache/zend_accelerator_module.c
@@ -356,8 +356,33 @@ void zend_accel_info(ZEND_MODULE_INFO_FUNC_ARGS)
if (!accel_startup_ok || zps_api_failure_reason) {
php_info_print_table_row(2, "Startup Failed", zps_api_failure_reason);
} else {
+ char buf[32];
php_info_print_table_row(2, "Startup", "OK");
php_info_print_table_row(2, "Shared memory model", zend_accel_get_shared_model());
+ snprintf(buf, sizeof(buf), "%ld", ZCSG(hits));
+ php_info_print_table_row(2, "Cache hits", buf);
+ snprintf(buf, sizeof(buf), "%ld", ZSMMG(memory_exhausted)?ZCSG(misses):ZCSG(misses)-ZCSG(blacklist_misses));
+ php_info_print_table_row(2, "Cache misses", buf);
+ snprintf(buf, sizeof(buf), "%ld", ZCG(accel_directives).memory_consumption-zend_shared_alloc_get_free_memory()-ZSMMG(wasted_shared_memory));
+ php_info_print_table_row(2, "Used memory", buf);
+ snprintf(buf, sizeof(buf), "%ld", zend_shared_alloc_get_free_memory());
+ php_info_print_table_row(2, "Free memory", buf);
+ snprintf(buf, sizeof(buf), "%ld", ZSMMG(wasted_shared_memory));
+ php_info_print_table_row(2, "Wasted memory", buf);
+ snprintf(buf, sizeof(buf), "%ld", ZCSG(hash).num_direct_entries);
+ php_info_print_table_row(2, "Cached scripts", buf);
+ snprintf(buf, sizeof(buf), "%ld", ZCSG(hash).num_entries);
+ php_info_print_table_row(2, "Cached keys", buf);
+ snprintf(buf, sizeof(buf), "%ld", ZCSG(hash).max_num_entries);
+ php_info_print_table_row(2, "Max keys", buf);
+ snprintf(buf, sizeof(buf), "%ld", ZCSG(oom_restarts));
+ php_info_print_table_row(2, "OOM restarts", buf);
+ snprintf(buf, sizeof(buf), "%ld", ZCSG(wasted_restarts));
+ php_info_print_table_row(2, "Wasted memory restarts", buf);
+ snprintf(buf, sizeof(buf), "%ld", ZCSG(hash_restarts));
+ php_info_print_table_row(2, "Hash keys restarts", buf);
+ snprintf(buf, sizeof(buf), "%ld", ZCSG(manual_restarts));
+ php_info_print_table_row(2, "Manual restarts", buf);
}
}