Mailing List Archive

r2506 - in trunk/varnish-cache: bin/varnishd include
Author: phk
Date: 2008-02-18 10:59:08 +0100 (Mon, 18 Feb 2008)
New Revision: 2506

Modified:
trunk/varnish-cache/bin/varnishd/cache_expire.c
trunk/varnish-cache/include/stat_field.h
Log:
Add a stats field to monitor the LRU move rate.


Modified: trunk/varnish-cache/bin/varnishd/cache_expire.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/cache_expire.c 2008-02-17 23:36:12 UTC (rev 2505)
+++ trunk/varnish-cache/bin/varnishd/cache_expire.c 2008-02-18 09:59:08 UTC (rev 2506)
@@ -106,6 +106,7 @@
CHECK_OBJ_NOTNULL(o, OBJECT_MAGIC);
if (o->lru_stamp + params->lru_timeout < now) {
LOCK(&exp_mtx); /* XXX: should be ..._TRY */
+ VSL_stats->n_lru_moved++;
if (o->timer_idx != lru_target && o->timer_idx != 0) {
VTAILQ_REMOVE(&exp_lru, o, deathrow);
VTAILQ_INSERT_TAIL(&exp_lru, o, deathrow);

Modified: trunk/varnish-cache/include/stat_field.h
===================================================================
--- trunk/varnish-cache/include/stat_field.h 2008-02-17 23:36:12 UTC (rev 2505)
+++ trunk/varnish-cache/include/stat_field.h 2008-02-18 09:59:08 UTC (rev 2506)
@@ -65,6 +65,7 @@
MAC_STAT(n_expired, uint64_t, 'i', "N expired objects")
MAC_STAT(n_lru_nuked, uint64_t, 'i', "N LRU nuked objects")
MAC_STAT(n_lru_saved, uint64_t, 'i', "N LRU saved objects")
+MAC_STAT(n_lru_moved, uint64_t, 'i', "N LRU moved objects")
MAC_STAT(n_deathrow, uint64_t, 'i', "N objects on deathrow")

MAC_STAT(losthdr, uint64_t, 'a', "HTTP header overflows")