1
0
Fork 0

htdocs/cacher: clogs->skips, compiling ad part of status

git-svn-id: svn://svn.lighttpd.net/xcache/trunk@1063 c26eb9a1-5813-0410-bd6c-c2e55f420ca7
This commit is contained in:
Xuefer 2012-07-27 16:03:21 +00:00
parent a24edd1fa0
commit 004ece5c2b
6 changed files with 42 additions and 33 deletions

View File

@ -17,8 +17,8 @@ $strings = array(
=> 'Percent Graph|Shows how much memory available in percent, and memory blocks status in graph',
'cache.operations'
=> 'Operations|Press the clear button to clean this cache',
'cache.compiling'
=> 'Comp.|Compiling flag, "yes" if the cache is busy compiling php script',
'cache.status'
=> 'Status|Compiling flag, "Compiling" if the cache is busy compiling php script. "Disabled" if cache is disabled',
'cache.hits'
=> 'Hits|Cache Hits, hit=a var/php is loaded from this cache',
'cache.hits_avg_h'
@ -29,8 +29,8 @@ $strings = array(
=> 'Hits/S|Average Hits per Second. Only last 5 seconds is logged',
'cache.updates'
=> 'Updates|Cache Updates',
'cache.clogs'
=> 'Clogs|Compiling Clogs, clog=compiling is needed but avoided to wait(be blocked) when the cache is busy compiling already',
'cache.skips'
=> 'Skips|Skips. Skip=updates are needed but skipped for some reason. e.g.: other process/thread is busy compiling on this cache',
'cache.ooms'
=> 'OOMs|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',
'cache.errors'
@ -48,7 +48,7 @@ $strings = array(
'entry.name'
=> 'Entry name|The entry name or filename',
'entry.hits'
=> 'Hits|Times this entry is hit (loaded from this cache)',
=> 'Hits|Hit times of this entry (loaded from this cache)',
'entry.size'
=> 'Size|Size in bytes of this entry in the cache',
'entry.refcount'

View File

@ -15,6 +15,10 @@ $strings = array(
=> '% 已用',
'Hits'
=> '命中',
'Normal'
=> '正常',
'Compiling(%s)'
=> '编译中(%s)',
'Modify'
=> '修改',
'See also'
@ -67,8 +71,8 @@ $strings = array(
=> '百分比图|条状显示可用内存的比例, 以及显示分配块状态',
'cache.operations'
=> '操作|点击按钮清除对应共享内存区的数据',
'cache.compiling'
=> '编译中|编译标记, 当共享内存区正在编译 php 脚本时标记为 "yes"',
'cache.status'
=> '状态|状态标记. 当共享内存区正在编译 php 脚本时标记为 "编译中". 当共享内存区暂停使用时标记为 "禁用"',
'cache.hits'
=> '命中|共享内存命中次数, 命中=从该共享内存载入php或者变量',
'cache.hits_avg_h'
@ -79,8 +83,8 @@ $strings = array(
=> '命中/S|每秒命中次数. 只统计最后 5 秒',
'cache.updates'
=> '更新|共享内存更新次数',
'cache.clogs'
=> '阻塞|编译阻塞跳过, 阻塞=当需该共享内存区负责编译时, 其他进程/现成无法访问此共享内存. 跳过=XCache 自动判断阻塞的共享内存区自动跳过阻塞等待, 直接使用非共享内存方式继续处理请求',
'cache.skips'
=> '阻塞|跳过更新次数, 跳过=XCache 自动判断阻塞的共享内存区自动跳过阻塞等待, 直接使用非共享内存方式继续处理请求',
'cache.ooms'
=> '内存不足|内存不足次数, 显示需要存储新数据但是共享内存区内存不足的次数. 如果出现太频繁请考虑加大配置中的 xcache.size 或者 xcache.var_size',
'cache.errors'

View File

@ -15,6 +15,10 @@ $strings = array(
=> '% 已用',
'Hits'
=> '命中',
'Normal'
=> '正常',
'Compiling(%s)'
=> '編譯中(%s)',
'Modify'
=> '修改',
'See also'
@ -67,8 +71,8 @@ $strings = array(
=> '百分比图|條狀顯示可用記憶體的比例',
'cache.operations'
=> '操作按鈕|點擊按鈕清除對應共享記憶體區的資料',
'cache.compiling'
=> '編譯中|編譯標記,當共享記憶體區正在編譯 php 指令時標記為 "yes"',
'cache.status'
=> '狀態|狀態標記. 當共享內存區正在編譯 php 腳本時標記為 "編譯中". 當共享內存區暫停使用時標記為 "禁用"',
'cache.hits'
=> '命中|共享記憶體命中次數,命中=從該共享記憶體載入php或者變數',
'cache.hits_avg_h'
@ -79,8 +83,8 @@ $strings = array(
=> '命中/S|每秒命中次数. 只统计最后 5 秒',
'cache.updates'
=> '更新|共享記憶更新過次數',
'cache.clogs'
=> '阻塞|編譯阻塞跳過,阻塞=當需該共享記憶體區負責編譯時,其他程序/現成無法存取此共享記憶體. 跳過=XCache 自動判斷阻塞的共享記憶體區自動跳過阻塞等待,直接使用非共享記憶體方式繼續處理請求',
'cache.skips'
=> '跳過|跳過更新次數,跳過=XCache 自動判斷阻塞的共享記憶體區自動跳過阻塞等待,直接使用非共享記憶體方式繼續處理請求',
'cache.ooms'
=> '記憶體不足|記憶體不足次數,顯示需要儲存新資料但是共享記憶體區記憶體不足的次數. 如果出現太頻繁請考慮加大配置中的 xcache.size 或者 xcache.var_size',
'cache.errors'

View File

@ -35,13 +35,13 @@ $b = new Cycle('class="col1"', 'class="col2"');
, th(N_("cache.used"))
, th(N_("cache.blocksgraph"))
, th(N_("cache.operations"))
, th(N_("cache.compiling"))
, th(N_("cache.status"))
, th(N_("cache.hits"))
, th(N_("cache.hits_graph"))
, th(N_("cache.hits_avg_h"))
, th(N_("cache.hits_avg_s"))
, th(N_("cache.updates"))
, th(N_("cache.clogs"))
, th(N_("cache.skips"))
, th(N_("cache.ooms"))
, th(N_("cache.errors"))
, th(N_("cache.readonly_protected"))
@ -52,7 +52,7 @@ $b = new Cycle('class="col1"', 'class="col2"');
?>
</tr>
<?php
$numkeys = explode(',', 'slots,size,avail,hits,updates,clogs,ooms,errors,cached,deleted');
$numkeys = explode(',', 'slots,size,avail,hits,updates,skips,ooms,errors,cached,deleted');
$l_clear = _('Clear');
$l_clear_confirm = _('Sure to clear?');
foreach ($cacheinfos as $i => $ci) {
@ -87,11 +87,16 @@ $b = new Cycle('class="col1"', 'class="col2"');
$hits_graph_h_w = count($ci['hits_by_hour']) * 2;
if (!empty($ci['istotal'])) {
$ci['compiling'] = '-';
$ci['status'] = '-';
$ci['can_readonly'] = '-';
}
else {
$ci['compiling'] = $ci['type'] == $type_php ? ($ci['compiling'] ? 'yes' : 'no') : '-';
if ($ci['type'] == $type_php) {
$ci['status'] = $ci['compiling'] ? sprintf(_('Compiling(%s)'), age($ci['compiling'])) : _('Normal');
}
else {
$ci['status'] = '-';
}
$ci['can_readonly'] = $ci['can_readonly'] ? 'yes' : 'no';
}
echo <<<EOS
@ -114,13 +119,13 @@ $b = new Cycle('class="col1"', 'class="col2"');
/></div
></form
></td>
<td>{$ci['compiling']}</td>
<td>{$ci['status']}</td>
<td>{$ci['hits']}</td>
<td><div class="hitsgraph" style="width: {$hits_graph_h_w}px">{$hits_graph_h}</div></td>
<td>{$hits_avg_h}</td>
<td>{$hits_avg_s}</td>
<td>{$ci['updates']}</td>
<td>{$ci['clogs']}</td>
<td>{$ci['skips']}</td>
<td>{$ci['ooms']}</td>
<td>{$ci['errors']}</td>
<td>{$ci['can_readonly']}</td>

View File

@ -181,11 +181,11 @@ function age($time)
for ($i = 6; $i >= 0; $i --) {
if ($delta >= $seconds[$i]) {
$ret = (int) ($delta / $seconds[$i]);
return $ret . ' ' . $name[$i];
return $ret . $name[$i];
}
}
return '0 s';
return '0s';
}
function stripaddslashes_array($value, $mqs = false)

View File

@ -70,7 +70,7 @@ struct _xc_cached_t { /* {{{ stored in shm */
time_t compiling;
zend_ulong updates;
zend_ulong hits;
zend_ulong clogs;
zend_ulong skips;
zend_ulong ooms;
zend_ulong errors;
@ -616,7 +616,8 @@ static void xc_fillinfo_unlocked(int cachetype, xc_cache_t *cache, zval *return_
add_assoc_long_ex(return_value, ZEND_STRS("updates"), cached->updates);
add_assoc_long_ex(return_value, ZEND_STRS("misses"), cached->updates); /* deprecated */
add_assoc_long_ex(return_value, ZEND_STRS("hits"), cached->hits);
add_assoc_long_ex(return_value, ZEND_STRS("clogs"), cached->clogs);
add_assoc_long_ex(return_value, ZEND_STRS("skips"), cached->skips);
add_assoc_long_ex(return_value, ZEND_STRS("clogs"), cached->skips); /* deprecated */
add_assoc_long_ex(return_value, ZEND_STRS("ooms"), cached->ooms);
add_assoc_long_ex(return_value, ZEND_STRS("errors"), cached->errors);
@ -2047,9 +2048,9 @@ static zend_op_array *xc_compile_file_cached(xc_compiler_t *compiler, zend_file_
xc_cache_t *cache = &xc_php_caches[compiler->entry_hash.cacheid];
xc_sandboxed_compiler_t sandboxed_compiler;
/* stale clogs precheck */
/* stale skips precheck */
if (XG(request_time) - cache->cached->compiling < 30) {
cache->cached->clogs ++;
cache->cached->skips ++;
return old_compile_file(h, type TSRMLS_CC);
}
@ -2109,7 +2110,7 @@ static zend_op_array *xc_compile_file_cached(xc_compiler_t *compiler, zend_file_
if (XG(request_time) - cache->cached->compiling < 30) {
TRACE("%s", "miss php, but compiling");
cache->cached->clogs ++;
cache->cached->skips ++;
gaveup = 1;
break;
}
@ -2296,12 +2297,7 @@ static xc_shm_t *xc_cache_destroy(xc_cache_t *caches, xc_hash_t *hcache) /* {{{
if (cache->lck) {
xc_lock_destroy(cache->lck);
}
/* do NOT free
if (cache->entries) {
cache->mem->handlers->free(cache->mem, cache->entries);
}
cache->mem->handlers->free(cache->mem, cache);
*/
/* do NOT touch cached data */
shm = cache->shm;
cache->shm->handlers->memdestroy(cache->mem);
}