Changeset 118


Ignore:
Timestamp:
2006-08-31T02:23:20+02:00 (8 years ago)
Author:
moo
Message:

show gc countdown in admin page

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/admin/xcache.tpl.php

    r109 r118  
    5454        <th>Cached</th> 
    5555        <th>Deleted</th> 
     56        <th>GC</th> 
    5657    </tr> 
    5758    <?php 
     
    9293        <td>{$ci['cached']}</td> 
    9394        <td>{$ci['deleted']}</td> 
     95        <td>{$ci['gc']}</td> 
    9496EOS; 
    9597 
  • trunk/xcache.c

    r116 r118  
    368368 
    369369/* helper functions for user functions */ 
    370 static void xc_fillinfo_dmz(xc_cache_t *cache, zval *return_value TSRMLS_DC) /* {{{ */ 
     370static void xc_fillinfo_dmz(int cachetype, xc_cache_t *cache, zval *return_value TSRMLS_DC) /* {{{ */ 
    371371{ 
    372372    zval *blocks; 
     
    376376#endif 
    377377    xc_mem_t *mem = cache->mem; 
     378    zend_ulong interval = cachetype = XC_TYPE_PHP ? xc_php_gc_interval : xc_var_gc_interval; 
    378379 
    379380    add_assoc_long_ex(return_value, ZEND_STRS("slots"),     cache->hentry->size); 
     
    386387    add_assoc_long_ex(return_value, ZEND_STRS("cached"),    cache->entries_count); 
    387388    add_assoc_long_ex(return_value, ZEND_STRS("deleted"),   cache->deletes_count); 
     389    if (interval) { 
     390        add_assoc_long_ex(return_value, ZEND_STRS("gc"),    (cache->last_gc_expires + interval) - XG(request_time)); 
     391    } 
     392    else { 
     393        add_assoc_null_ex(return_value, ZEND_STRS("gc")); 
     394    } 
    388395 
    389396    MAKE_STD_ZVAL(blocks); 
     
    14351442            ENTER_LOCK(cache) { 
    14361443                if (optype == XC_OP_INFO) { 
    1437                     xc_fillinfo_dmz(cache, return_value TSRMLS_CC); 
     1444                    xc_fillinfo_dmz(type, cache, return_value TSRMLS_CC); 
    14381445                } 
    14391446                else { 
Note: See TracChangeset for help on using the changeset viewer.