com php-src: add start and restart times: ext/opcache/zend_ac celerator_module.c
| From: | Antony Dovgal | Date: | Thu, 12 Dec 2013 08:47:43 +0000 |
| Subject: | com php-src: add start and restart times: ext/opcache/zend_ac celerator_module.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-76632@lists.php.net to get a copy of this message | ||
Commit: f88a95b6425ff987c832b576ecda0dfc4f045242
Author: Antony Dovgal <tony2001@php.net> Thu, 5 Dec 2013 18:20:03 +0400
Parents: 497bf545717c28865afef8746909e497f1a27b6d
Branches: badoo-5.5_mysqlnd
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=f88a95b6425ff987c832b576ecda0dfc4f045242
Log:
add start and restart times
Changed paths:
M ext/opcache/zend_accelerator_module.c
Diff:
diff --git a/ext/opcache/zend_accelerator_module.c b/ext/opcache/zend_accelerator_module.c
index b4fbb2f..1abbf1e 100644
--- a/ext/opcache/zend_accelerator_module.c
+++ b/ext/opcache/zend_accelerator_module.c
@@ -31,6 +31,7 @@
#include "TSRM/tsrm_virtual_cwd.h"
#include "ext/standard/info.h"
#include "ext/standard/php_filestat.h"
+#include "ext/date/php_date.h"
#define STRING_NOT_NULL(s) (NULL == (s)?"":s)
#define MIN_ACCEL_FILES 200
@@ -424,6 +425,8 @@ void zend_accel_info(ZEND_MODULE_INFO_FUNC_ARGS)
php_info_print_table_row(2, "Startup Failed", zps_api_failure_reason);
} else {
char buf[32];
+ char *start_time, *restart_time;
+
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));
@@ -448,6 +451,14 @@ void zend_accel_info(ZEND_MODULE_INFO_FUNC_ARGS)
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);
+
+ start_time = php_format_date("d-M-Y H:i:s", sizeof("d-M-Y H:i:s")-1,
ZCSG(start_time), 1 TSRMLS_CC);
+ php_info_print_table_row(2, "Start time", start_time);
+ efree(start_time);
+
+ restart_time = php_format_date("d-M-Y H:i:s", sizeof("d-M-Y H:i:s")-1,
ZCSG(last_restart_time), 1 TSRMLS_CC);
+ php_info_print_table_row(2, "Last restart time", restart_time);
+ efree(restart_time);
}
}