Changeset 936 in svn


Ignore:
Timestamp:
2012-06-28T09:45:40+02:00 (3 years ago)
Author:
Xuefer
Message:

change misses to updates. misses is kept for compatibility reason but deprecated

Location:
trunk
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/admin/common-zh-simplified-utf-8.lang.php

    r605 r936  
    3636        'Hits/S'
    3737        => '命中/S',
    38         'Misses'
    39         => '错过',
     38        'Updates'
     39        => '更新',
    4040        'Clogs'
    4141        => '阻塞',
  • trunk/admin/common-zh-traditional-utf-8.lang.php

    r605 r936  
    3636        'Hits/S'
    3737        => '命中/S',
    38         'Misses'
    39         => '錯過',
     38        'Updates'
     39        => '更新',
    4040        'Clogs'
    4141        => '阻塞',
  • trunk/admin/help-en.lang.php

    r605 r936  
    1111<dt><?php echo _T('Hits 24H'); ?>: </dt><dd>Hits 24 Hours. Hits graph of last 24 hours</dd>
    1212<dt><?php echo _T('Hits/S'); ?>: </dt><dd>Average Hits per Second. Only last 5 seconds is logged</dd>
    13 <dt><?php echo _T('Misses'); ?>: </dt><dd>Cache Misses, miss=a var/php is requested but not in the cache</dd>
     13<dt><?php echo _T('Updates'); ?>: </dt><dd>Cache Updates, miss=a var/php is requested but not in the cache</dd>
    1414<dt><?php echo _T('Clogs'); ?>: </dt><dd>Compiling Clogs, clog=compiling is needed but avoided to wait(be blocked) when the cache is busy compiling already</dd>
    1515<dt><?php echo _T('OOMs'); ?>: </dt><dd>Out Of Memory, how many times a new item should be stored but there isn't enough memory in the cache, think of increasing the xcache.size or xcache.var_size</dd>
  • trunk/admin/help-zh-simplified-utf-8.lang.php

    r605 r936  
    1111<dt><?php echo _T('Hits 24H'); ?>: </dt><dd>24 小时命中分布图. 图表现是最后 24 小时的命中次数</dd>
    1212<dt><?php echo _T('Hits/S'); ?>: </dt><dd>每秒命中次数. 只统计最后 5 秒</dd>
    13 <dt><?php echo _T('Misses'); ?>: </dt><dd>共享内存错过次数, 错过=请求的php或者变量并不在该共享内存内</dd>
     13<dt><?php echo _T('Updates'); ?>: </dt><dd>共享内存更新次数</dd>
    1414<dt><?php echo _T('Clogs'); ?>: </dt><dd>编译阻塞跳过, 阻塞=当需该共享内存区负责编译时, 其他进程/现成无法访问此共享内存. 跳过=XCache 自动判断阻塞的共享内存区自动跳过阻塞等待, 直接使用非共享内存方式继续处理请求</dd>
    1515<dt><?php echo _T('OOMs'); ?>: </dt><dd>内存不足次数, 显示需要存储新数据但是共享内存区内存不足的次数. 如果出现太频繁请考虑加大配置中的 xcache.size 或者 xcache.var_size</dd>
  • trunk/admin/help-zh-traditional-utf-8.lang.php

    r605 r936  
    88<dt><?php echo _T('Compiling'); ?>: </dt><dd>編譯標記,當共享記憶體區正在編譯 php 指令時標記為 "yes"</dd>
    99<dt><?php echo _T('Hits'); ?>: </dt><dd>共享記憶體命中次數,命中=從該共享記憶體載入php或者變數</dd>
    10 <dt><?php echo _T('Misses'); ?>: </dt><dd>共享記憶體錯過次數,錯過=請求的php或者變數並不在該共享記憶體內</dd>
     10<dt><?php echo _T('Updates'); ?>: </dt><dd>共享記憶更新過次數</dd>
    1111<dt><?php echo _T('Clogs'); ?>: </dt><dd>編譯阻塞跳過,阻塞=當需該共享記憶體區負責編譯時,其他程序/現成無法存取此共享記憶體. 跳過=XCache 自動判斷阻塞的共享記憶體區自動跳過阻塞等待,直接使用非共享記憶體方式繼續處理請求</dd>
    1212<dt><?php echo _T('OOMs'); ?>: </dt><dd>記憶體不足次數,顯示需要儲存新資料但是共享記憶體區記憶體不足的次數. 如果出現太頻繁請考慮加大配置中的 xcache.size 或者 xcache.var_size</dd>
  • trunk/admin/xcache.tpl.php

    r931 r936  
    4040        <th><?php echo _T('Hits 24H'); ?></th>
    4141        <th><?php echo _T('Hits/S'); ?></th>
    42         <th><?php echo _T('Misses'); ?></th>
     42        <th><?php echo _T('Updates'); ?></th>
    4343        <th><?php echo _T('Clogs'); ?></th>
    4444        <th><?php echo _T('OOMs'); ?></th>
     
    5050    </tr>
    5151    <?php
    52     $numkeys = explode(',', 'slots,size,avail,hits,misses,clogs,ooms,errors,cached,deleted');
     52    $numkeys = explode(',', 'slots,size,avail,hits,updates,clogs,ooms,errors,cached,deleted');
    5353    $l_clear = _T('Clear');
    5454    $l_clear_confirm = _T('Sure to clear?');
     
    117117        <td><div class="hitsgraph" style="width: {$hits_graph_h_w}px">{$hits_graph_h}</div></td>
    118118        <td>{$hits_avg_s}</td>
    119         <td>{$ci['misses']}</td>
     119        <td>{$ci['updates']}</td>
    120120        <td>{$ci['clogs']}</td>
    121121        <td>{$ci['ooms']}</td>
  • trunk/xcache.c

    r931 r936  
    281281    if (stored_entry) {
    282282        xc_entry_add_unlocked(cache, entryslotid, stored_entry);
     283        ++cache->updates;
    283284        return stored_entry;
    284285    }
     
    592593    add_assoc_long_ex(return_value, ZEND_STRS("slots"),     cache->hentry->size);
    593594    add_assoc_long_ex(return_value, ZEND_STRS("compiling"), cache->compiling);
    594     add_assoc_long_ex(return_value, ZEND_STRS("misses"),    cache->misses);
     595    add_assoc_long_ex(return_value, ZEND_STRS("updates"),   cache->updates);
     596    add_assoc_long_ex(return_value, ZEND_STRS("misses"),    cache->updates); /* deprecated */
    595597    add_assoc_long_ex(return_value, ZEND_STRS("hits"),      cache->hits);
    596598    add_assoc_long_ex(return_value, ZEND_STRS("clogs"),     cache->clogs);
     
    16011603}
    16021604/* }}} */
    1603 static zend_op_array *xc_compile_php(xc_compiler_t *compiler, zend_file_handle *h, int type TSRMLS_DC) /* {{{ */
    1604 {
    1605     zend_op_array *op_array;
     1605static void xc_compile_php(xc_compiler_t *compiler, zend_file_handle *h, int type TSRMLS_DC) /* {{{ */
     1606{
    16061607    zend_uint old_constinfo_cnt, old_funcinfo_cnt, old_classinfo_cnt;
    16071608    zend_bool catched = 0;
     
    16141615    old_constinfo_cnt = zend_hash_num_elements(EG(zend_constants));
    16151616
    1616     compiler->new_php.op_array = NULL;
    1617     XG(initial_compile_file_called) = 0;
    16181617    zend_try {
    1619         op_array = old_compile_file(h, type TSRMLS_CC);
     1618        compiler->new_php.op_array = old_compile_file(h, type TSRMLS_CC);
    16201619    } zend_catch {
    16211620        catched = 1;
     
    16261625    }
    16271626
    1628     if (op_array == NULL) {
     1627    if (compiler->new_php.op_array == NULL) {
    16291628        goto err_op_array;
    16301629    }
    16311630
    16321631    if (!XG(initial_compile_file_called)) {
    1633         return op_array;
     1632        return;
    16341633    }
    16351634
     
    16371636    /* {{{ prepare */
    16381637    zend_restore_compiled_filename(h->opened_path ? h->opened_path : (char *) h->filename TSRMLS_CC);
    1639     compiler->new_php.op_array = op_array;
    16401638
    16411639#ifdef HAVE_XCACHE_CONSTANT
     
    18191817#endif
    18201818
    1821     return op_array;
     1819    return;
    18221820
    18231821err_alloc:
     
    18301828        zend_bailout();
    18311829    }
    1832 
    1833     return op_array;
    18341830}
    18351831/* }}} */
     
    19121908    */
    19131909
    1914     zend_op_array *op_array;
    19151910    xc_entry_php_t *stored_entry;
    19161911    xc_entry_data_php_t *stored_php;
     
    19561951        }
    19571952
    1958         cache->misses ++;
    19591953        TRACE("miss entry %d:%s", compiler->new_entry.file_inode, compiler->new_entry.entry.name.str.val);
    19601954
     
    20082002    /* }}} */
    20092003
    2010     op_array = NULL;
    20112004    /* {{{ compile */
    20122005    /* make compile inside sandbox */
    2013     xc_sandbox_init(&sandbox, h->opened_path ? h->opened_path : h->filename TSRMLS_CC);
    20142006
    20152007#ifdef HAVE_XCACHE_CONSTANT
     
    20232015    memset(&compiler->new_php.op_array_info, 0, sizeof(compiler->new_php.op_array_info));
    20242016
     2017    XG(initial_compile_file_called) = 0;
    20252018    zend_try {
    2026         op_array = xc_compile_php(compiler, h, type TSRMLS_CC);
     2019        xc_sandbox_init(&sandbox, h->opened_path ? h->opened_path : h->filename TSRMLS_CC);
     2020        compiler->new_php.op_array = NULL;
     2021        xc_compile_php(compiler, h, type TSRMLS_CC);
    20272022    } zend_catch {
    20282023        catched = 1;
    20292024    } zend_end_try();
    20302025
    2031     if (catched || !op_array) {
     2026    if (catched
     2027     || !compiler->new_php.op_array /* possible ? */
     2028     || !XG(initial_compile_file_called)) {
    20322029        goto err_aftersandbox;
    20332030    }
    20342031
    2035     /* not cachable */
    2036     if (!compiler->new_php.op_array) {
    2037         cache->compiling = 0;
    2038         /* it's not cachable, but don't scare the users with high misses */
    2039         cache->misses --;
    2040         xc_sandbox_free(&sandbox, XC_InstallNoBinding TSRMLS_CC);
    2041         return op_array;
    2042     }
    20432032    /* }}} */
    20442033#ifdef SHOW_DPRINT
     
    20652054    TRACE("%s", stored_entry ? "stored" : "store failed");
    20662055
     2056    if (catched || !stored_php) {
     2057        goto err_aftersandbox;
     2058    }
     2059
    20672060    cache->compiling = 0;
    2068     if (catched) {
    2069         goto err_aftersandbox;
    2070     }
    2071 
    20722061    xc_free_php(&compiler->new_php TSRMLS_CC);
    20732062
    20742063    if (stored_entry) {
    2075         if (op_array) {
     2064        if (compiler->new_php.op_array) {
    20762065#ifdef ZEND_ENGINE_2
    2077             destroy_op_array(op_array TSRMLS_CC);
     2066            destroy_op_array(compiler->new_php.op_array TSRMLS_CC);
    20782067#else
    2079             destroy_op_array(op_array);
    2080 #endif
    2081             efree(op_array);
     2068            destroy_op_array(compiler->new_php.op_array);
     2069#endif
     2070            efree(compiler->new_php.op_array);
     2071            compiler->new_php.op_array = NULL;
    20822072            h = NULL;
    20832073        }
     
    20882078        zend_op_array *old_active_op_array = CG(active_op_array);
    20892079        /* install it */
    2090         CG(active_op_array) = op_array;
     2080        CG(active_op_array) = compiler->new_php.op_array;
    20912081        xc_sandbox_free(&sandbox, XC_Install TSRMLS_CC);
    20922082        CG(active_op_array) = old_active_op_array;
    20932083    }
    2094     return op_array;
     2084    return compiler->new_php.op_array;
    20952085
    20962086err_aftersandbox:
     
    20982088    xc_sandbox_free(&sandbox, XC_NoInstall TSRMLS_CC);
    20992089
     2090    cache->compiling = 0;
    21002091    if (catched) {
    2101         cache->compiling = 0;
    21022092        cache->errors ++;
    21032093        zend_bailout();
    21042094    }
    2105     return op_array;
     2095    return compiler->new_php.op_array;
    21062096}
    21072097/* }}} */
     
    28392829        else {
    28402830            RETVAL_NULL();
    2841             cache->misses ++;
    28422831        }
    28432832    } LEAVE_LOCK(cache);
     
    30253014                zv = (zval *) cache->shm->handlers->to_readwrite(cache->shm, (char *) stored_entry_var->value);
    30263015                Z_LVAL_P(zv) = value;
     3016                ++cache->updates;
    30273017                break; /* leave lock */
    30283018            }
  • trunk/xcache.h

    r923 r936  
    261261
    262262    time_t     compiling;
    263     zend_ulong misses;
     263    zend_ulong updates;
    264264    zend_ulong hits;
    265265    zend_ulong clogs;
Note: See TracChangeset for help on using the changeset viewer.