From 54f2a81e992c31925d77c3f38615af8cb381fd38 Mon Sep 17 00:00:00 2001 From: Xuefer Date: Sat, 14 Jul 2007 05:10:55 +0000 Subject: [PATCH] merged [456] from trunk: fixed #133: add "compile failures" in XCache admin stats git-svn-id: svn://svn.lighttpd.net/xcache/branches/1.2@457 c26eb9a1-5813-0410-bd6c-c2e55f420ca7 --- admin/common-zh-simplified-utf-8.lang.php | 2 ++ admin/common-zh-traditional-utf-8.lang.php | 2 ++ admin/help-en.lang.php | 1 + admin/help-zh-simplified-utf-8.lang.php | 1 + admin/help-zh-traditional-utf-8.lang.php | 1 + admin/xcache.tpl.php | 4 +++- xcache.c | 2 ++ xcache.h | 1 + 8 files changed, 13 insertions(+), 1 deletion(-) diff --git a/admin/common-zh-simplified-utf-8.lang.php b/admin/common-zh-simplified-utf-8.lang.php index dc5d93d..e4814be 100644 --- a/admin/common-zh-simplified-utf-8.lang.php +++ b/admin/common-zh-simplified-utf-8.lang.php @@ -33,6 +33,8 @@ $strings = array( => '阻塞', 'OOMs' => '内存不足', + 'Errors' + => '错误', 'Protected' => '保护', 'Cached' diff --git a/admin/common-zh-traditional-utf-8.lang.php b/admin/common-zh-traditional-utf-8.lang.php index cbc7af4..2429492 100644 --- a/admin/common-zh-traditional-utf-8.lang.php +++ b/admin/common-zh-traditional-utf-8.lang.php @@ -33,6 +33,8 @@ $strings = array( => '阻塞', 'OOMs' => '記憶體不足', + 'Errors' + => '错误', 'Protected' => '保護', 'Cached' diff --git a/admin/help-en.lang.php b/admin/help-en.lang.php index 1ac0c6c..4e2a923 100644 --- a/admin/help-en.lang.php +++ b/admin/help-en.lang.php @@ -10,6 +10,7 @@
:
Cache Misses, miss=a var/php is requested but not in the cache
:
Compiling Clogs, clog=compiling is needed but avoided to wait(be blocked) when the cache is busy compiling already
:
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
+
:
Compiler errors, how many times your script is compiled but failed. You should really check what is happening if you see this value increase. See ini.error-log and ini.display-errors
:
Whether readonly_protection is available and enable on this cache
:
Number of entries stored in this cache
:
Number of entries is pending in delete list (expired but referenced)
diff --git a/admin/help-zh-simplified-utf-8.lang.php b/admin/help-zh-simplified-utf-8.lang.php index 018b298..1093358 100644 --- a/admin/help-zh-simplified-utf-8.lang.php +++ b/admin/help-zh-simplified-utf-8.lang.php @@ -10,6 +10,7 @@
:
共享内存错过次数, 错过=请求的php或者变量并不在该共享内存内
:
编译阻塞跳过, 阻塞=当需该共享内存区负责编译时, 其他进程/现成无法访问此共享内存. 跳过=XCache 自动判断阻塞的共享内存区自动跳过阻塞等待, 直接使用非共享内存方式继续处理请求
:
内存不足次数, 显示需要存储新数据但是共享内存区内存不足的次数. 如果出现太频繁请考虑加大配置中的 xcache.size 或者 xcache.var_size
+
:
编译错误, 显示您的脚本被编译时出错的次数. 如果您发现这个数字不断增长, 您应该检查什么脚本产生错误. 参考 ini.error-log and ini.display-errors
:
显示该 Cache 是否支持并启用 readonly_protection
:
共享内存于该共享内存区的项目条数
:
共享内存区内将要删除的项目 (已经删除但是还被某些进程占用)
diff --git a/admin/help-zh-traditional-utf-8.lang.php b/admin/help-zh-traditional-utf-8.lang.php index d698819..755611c 100644 --- a/admin/help-zh-traditional-utf-8.lang.php +++ b/admin/help-zh-traditional-utf-8.lang.php @@ -10,6 +10,7 @@
:
共享記憶體錯過次數,錯過=請求的php或者變數並不在該共享記憶體內
:
編譯阻塞跳過,阻塞=當需該共享記憶體區負責編譯時,其他程序/現成無法存取此共享記憶體. 跳過=XCache 自動判斷阻塞的共享記憶體區自動跳過阻塞等待,直接使用非共享記憶體方式繼續處理請求
:
記憶體不足次數,顯示需要儲存新資料但是共享記憶體區記憶體不足的次數. 如果出現太頻繁請考慮加大配置中的 xcache.size 或者 xcache.var_size
+
:
编译错误, 显示您的脚本被编译时出错的次数. 如果您发现这个数字不断增长, 您应该检查什么脚本产生错误. 参考 ini.error-log and ini.display-errors
:
顯示該 Cache 是否支援並啟用 readonly_protection
:
共享記憶體於該共享記憶體區的項目個數
:
共享記憶體區內將要刪除的項目 (已經刪除但是還被某些程序佔用)
diff --git a/admin/xcache.tpl.php b/admin/xcache.tpl.php index 54c825f..782f372 100644 --- a/admin/xcache.tpl.php +++ b/admin/xcache.tpl.php @@ -34,13 +34,14 @@ $b = new Cycle('class="col1"', 'class="col2"'); + $ci) { @@ -75,6 +76,7 @@ $b = new Cycle('class="col1"', 'class="col2"'); {$ci['misses']} {$ci['clogs']} {$ci['ooms']} + {$ci['errors']} {$ci['can_readonly']} {$ci['cached']} {$ci['deleted']} diff --git a/xcache.c b/xcache.c index 7392fb2..dc0b9ec 100644 --- a/xcache.c +++ b/xcache.c @@ -416,6 +416,7 @@ static void xc_fillinfo_dmz(int cachetype, xc_cache_t *cache, zval *return_value add_assoc_long_ex(return_value, ZEND_STRS("hits"), cache->hits); add_assoc_long_ex(return_value, ZEND_STRS("clogs"), cache->clogs); add_assoc_long_ex(return_value, ZEND_STRS("ooms"), cache->ooms); + add_assoc_long_ex(return_value, ZEND_STRS("errors"), cache->errors); add_assoc_long_ex(return_value, ZEND_STRS("cached"), cache->entries_count); add_assoc_long_ex(return_value, ZEND_STRS("deleted"), cache->deletes_count); @@ -1161,6 +1162,7 @@ err_bailout: cache->compiling = 0; } LEAVE_LOCK(cache); if (catched) { + cache->errors ++; zend_bailout(); } if (xc_test && stored_xce) { diff --git a/xcache.h b/xcache.h index 125f3d1..4373930 100644 --- a/xcache.h +++ b/xcache.h @@ -175,6 +175,7 @@ typedef struct { zend_ulong hits; zend_ulong clogs; zend_ulong ooms; + zend_ulong errors; xc_lock_t *lck; xc_shm_t *shm; /* to which shm contains us */ xc_mem_t *mem; /* to which mem contains us */