]> granicus.if.org Git - php/commitdiff
Separate "start_time" from "last_restart_time"
authorDmitry Stogov <dmitry@zend.com>
Mon, 25 Mar 2013 08:33:24 +0000 (12:33 +0400)
committerDmitry Stogov <dmitry@zend.com>
Mon, 25 Mar 2013 08:33:24 +0000 (12:33 +0400)
ext/opcache/ZendAccelerator.c
ext/opcache/ZendAccelerator.h
ext/opcache/zend_accelerator_module.c

index e634c130dae5e70b99172c9c0c78939c76e9539a..9d1fdce1b57acca1747894225ad3ecce9dabd5fe 100644 (file)
@@ -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);
index cd89bcc2f1c8218ad853d89c798501667fca9d79..c611d65dede8347352bf33f06f3235ebc9fb96e9 100644 (file)
@@ -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;
index 778fee54b38f01e7d36e9f36d5082559d08c2a31..0d452adf854d2fff7d0e19209522e67f4a8e5361 100644 (file)
@@ -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));