Skip to content

Commit 64b029a

Browse files
committed
Separate "start_time" from "last_restart_time"
1 parent 987dee9 commit 64b029a

File tree

3 files changed

+4
-1
lines changed

3 files changed

+4
-1
lines changed

ext/opcache/ZendAccelerator.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2362,7 +2362,8 @@ static void zend_accel_init_shm(TSRMLS_D)
23622362
ZCSG(manual_restarts) = 0;
23632363

23642364
ZCSG(accelerator_enabled) = 1;
2365-
ZCSG(last_restart_time) = zend_accel_get_time();
2365+
ZCSG(start_time) = zend_accel_get_time();
2366+
ZCSG(last_restart_time) = 0;
23662367
ZCSG(restart_in_progress) = 0;
23672368

23682369
zend_shared_alloc_unlock(TSRMLS_C);

ext/opcache/ZendAccelerator.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -275,6 +275,7 @@ typedef struct _zend_accel_shared_globals {
275275
zend_accel_hash include_paths; /* used "include_path" values */
276276

277277
/* Directives & Maintenance */
278+
time_t start_time;
278279
time_t last_restart_time;
279280
time_t force_restart_time;
280281
zend_bool accelerator_enabled;

ext/opcache/zend_accelerator_module.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -503,6 +503,7 @@ static ZEND_FUNCTION(opcache_get_status)
503503
add_assoc_long(statistics, "num_cached_keys", ZCSG(hash).num_entries);
504504
add_assoc_long(statistics, "max_cached_keys", ZCSG(hash).max_num_entries);
505505
add_assoc_long(statistics, "hits", ZCSG(hits));
506+
add_assoc_long(statistics, "start_time", ZCSG(start_time));
506507
add_assoc_long(statistics, "last_restart_time", ZCSG(last_restart_time));
507508
add_assoc_long(statistics, "oom_restarts", ZCSG(oom_restarts));
508509
add_assoc_long(statistics, "wasted_restarts", ZCSG(wasted_restarts));

0 commit comments

Comments
 (0)