]> err.no Git - varnish/commitdiff
Keep an eye on deathrow
authorphk <phk@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Thu, 20 Jul 2006 14:46:49 +0000 (14:46 +0000)
committerphk <phk@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Thu, 20 Jul 2006 14:46:49 +0000 (14:46 +0000)
git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@529 d4fa192b-c00b-0410-8231-f00ffab90ce4

varnish-cache/bin/varnishd/cache_expire.c
varnish-cache/include/stat_field.h

index 5bd53fe4c2b5b8e5fb525bd01db81b042f22d1c3..a1c570bfba2300423497191373c7f9b6ba887965 100644 (file)
@@ -76,8 +76,10 @@ exp_hangman(void *arg)
                        continue;
                }
                TAILQ_REMOVE(&exp_deathrow, o, deathrow);
+               VSL_stats->n_deathrow--;
+               VSL_stats->n_expired++;
                AZ(pthread_mutex_unlock(&exp_mtx));
-               VSL(SLT_ExpKill, 0, "%u", o->xid);
+               VSL(SLT_ExpKill, 0, "%u %d", o->xid, (int)(o->ttl - t));
                HSH_Deref(o);
        }
 }
@@ -124,6 +126,7 @@ exp_prefetch(void *arg)
                if (sp->handling == VCL_RET_DISCARD) {
                        AZ(pthread_mutex_lock(&exp_mtx));
                        TAILQ_INSERT_TAIL(&exp_deathrow, o, deathrow);
+                       VSL_stats->n_deathrow++;
                        AZ(pthread_mutex_unlock(&exp_mtx));
                        continue;
                }
index 3ca5ebca13ae6c29512ba634eb0a5150e4877ae8..b1463b8afffc397d90e80f36bfa25d3ea0bf8f86 100644 (file)
@@ -26,4 +26,7 @@ MAC_STAT(n_wrk_max,           uint64_t, "u", "N worker threads limited")
 MAC_STAT(n_wrk_busy,           uint64_t, "u", "N busy worker threads")
 MAC_STAT(n_wrk_queue,          uint64_t, "u", "N queued work requests")
 
+MAC_STAT(n_expired,            uint64_t, "u", "N expired objects")
+MAC_STAT(n_deathrow,           uint64_t, "u", "N objects on deathrow")
+
 MAC_STAT(losthdr,              uint64_t, "u", "HTTP header overflows")