From 64b029af0dc7d044586db9a554e0a47783076cc8 Mon Sep 17 00:00:00 2001 From: Dmitry Stogov Date: Mon, 25 Mar 2013 12:33:24 +0400 Subject: [PATCH] Separate "start_time" from "last_restart_time" --- ext/opcache/ZendAccelerator.c | 3 ++- ext/opcache/ZendAccelerator.h | 1 + ext/opcache/zend_accelerator_module.c | 1 + 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/ext/opcache/ZendAccelerator.c b/ext/opcache/ZendAccelerator.c index e634c130da..9d1fdce1b5 100644 --- a/ext/opcache/ZendAccelerator.c +++ b/ext/opcache/ZendAccelerator.c @@ -2362,7 +2362,8 @@ static void zend_accel_init_shm(TSRMLS_D) ZCSG(manual_restarts) = 0; ZCSG(accelerator_enabled) = 1; - ZCSG(last_restart_time) = zend_accel_get_time(); + ZCSG(start_time) = zend_accel_get_time(); + ZCSG(last_restart_time) = 0; ZCSG(restart_in_progress) = 0; zend_shared_alloc_unlock(TSRMLS_C); diff --git a/ext/opcache/ZendAccelerator.h b/ext/opcache/ZendAccelerator.h index cd89bcc2f1..c611d65ded 100644 --- a/ext/opcache/ZendAccelerator.h +++ b/ext/opcache/ZendAccelerator.h @@ -275,6 +275,7 @@ typedef struct _zend_accel_shared_globals { zend_accel_hash include_paths; /* used "include_path" values */ /* Directives & Maintenance */ + time_t start_time; time_t last_restart_time; time_t force_restart_time; zend_bool accelerator_enabled; diff --git a/ext/opcache/zend_accelerator_module.c b/ext/opcache/zend_accelerator_module.c index 778fee54b3..0d452adf85 100644 --- a/ext/opcache/zend_accelerator_module.c +++ b/ext/opcache/zend_accelerator_module.c @@ -503,6 +503,7 @@ static ZEND_FUNCTION(opcache_get_status) add_assoc_long(statistics, "num_cached_keys", ZCSG(hash).num_entries); add_assoc_long(statistics, "max_cached_keys", ZCSG(hash).max_num_entries); add_assoc_long(statistics, "hits", ZCSG(hits)); + add_assoc_long(statistics, "start_time", ZCSG(start_time)); add_assoc_long(statistics, "last_restart_time", ZCSG(last_restart_time)); add_assoc_long(statistics, "oom_restarts", ZCSG(oom_restarts)); add_assoc_long(statistics, "wasted_restarts", ZCSG(wasted_restarts)); -- 2.40.0