From e14790286e27f9d92b417618c8a5351fc69bdd3c Mon Sep 17 00:00:00 2001 From: phk Date: Mon, 18 Feb 2008 09:59:08 +0000 Subject: [PATCH] Add a stats field to monitor the LRU move rate. git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@2506 d4fa192b-c00b-0410-8231-f00ffab90ce4 --- varnish-cache/bin/varnishd/cache_expire.c | 1 + varnish-cache/include/stat_field.h | 1 + 2 files changed, 2 insertions(+) diff --git a/varnish-cache/bin/varnishd/cache_expire.c b/varnish-cache/bin/varnishd/cache_expire.c index 5381a701..f12d1b08 100644 --- a/varnish-cache/bin/varnishd/cache_expire.c +++ b/varnish-cache/bin/varnishd/cache_expire.c @@ -106,6 +106,7 @@ EXP_Touch(struct object *o, double now) 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); diff --git a/varnish-cache/include/stat_field.h b/varnish-cache/include/stat_field.h index f2736d29..90baaa12 100644 --- a/varnish-cache/include/stat_field.h +++ b/varnish-cache/include/stat_field.h @@ -65,6 +65,7 @@ MAC_STAT(n_backend, uint64_t, 'i', "N backends") 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") -- 2.39.5