From: phk Date: Wed, 28 Jun 2006 09:39:25 +0000 (+0000) Subject: More stats counters X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fd29c4f12fa064390fbe78d699a42bc6839178ef;p=varnish More stats counters git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@244 d4fa192b-c00b-0410-8231-f00ffab90ce4 --- diff --git a/varnish-cache/bin/varnishd/cache_acceptor.c b/varnish-cache/bin/varnishd/cache_acceptor.c index a3944587..d1cac276 100644 --- a/varnish-cache/bin/varnishd/cache_acceptor.c +++ b/varnish-cache/bin/varnishd/cache_acceptor.c @@ -122,7 +122,7 @@ accept_f(int fd, short event, void *arg) char port[10]; int i; - VSL_stats->cli_conn++; + VSL_stats->client_conn++; (void)arg; sm = calloc(sizeof *sm, 1); diff --git a/varnish-cache/bin/varnishd/cache_backend.c b/varnish-cache/bin/varnishd/cache_backend.c index 15965e8c..951bdfb0 100644 --- a/varnish-cache/bin/varnishd/cache_backend.c +++ b/varnish-cache/bin/varnishd/cache_backend.c @@ -239,6 +239,7 @@ VBE_GetFd(struct backend *bp, void **ptr) vp->nconn++; AZ(pthread_mutex_unlock(&vbemtx)); connect_to_backend(vc, bp); + VSL_stats->backend_conn++; event_set(&vc->ev, vc->fd, EV_READ | EV_PERSIST, vbe_rdf, vc); event_base_set(vbe_evb, &vc->ev); } @@ -270,6 +271,7 @@ VBE_RecycleFd(void *ptr) struct vbe_conn *vc; int i; + VSL_stats->backend_recycle++; vc = ptr; VSL(SLT_BackendReuse, vc->fd, ""); i = write(vbe_pipe[1], &vc, sizeof vc); diff --git a/varnish-cache/bin/varnishd/cache_pool.c b/varnish-cache/bin/varnishd/cache_pool.c index 34834b5e..4699a3d8 100644 --- a/varnish-cache/bin/varnishd/cache_pool.c +++ b/varnish-cache/bin/varnishd/cache_pool.c @@ -31,10 +31,13 @@ LookupSession(struct worker *w, struct sess *sp) o = HSH_Lookup(w, sp->http); sp->obj = o; - if (o->busy) + if (o->busy) { + VSL_stats->cache_miss++; VCL_miss_method(sp); - else + } else { + VSL_stats->cache_hit++; VCL_hit_method(sp); + } return (0); } @@ -133,6 +136,7 @@ DealWithSession(void *arg, int good) vca_return_session(sp); return; } + VSL_stats->client_req++; AZ(pthread_mutex_lock(&sessmtx)); TAILQ_INSERT_TAIL(&shd, sp, list); AZ(pthread_mutex_unlock(&sessmtx)); diff --git a/varnish-cache/include/stat_field.h b/varnish-cache/include/stat_field.h index 97202b5f..74948271 100644 --- a/varnish-cache/include/stat_field.h +++ b/varnish-cache/include/stat_field.h @@ -1,11 +1,11 @@ /* $Id$ */ -MAC_STAT(cli_conn, uint64_t, "u", "Client connections accepted") -MAC_STAT(cli_req, uint64_t, "u", "Client requests received") +MAC_STAT(client_conn, uint64_t, "u", "Client connections accepted") +MAC_STAT(client_req, uint64_t, "u", "Client requests received") -MAC_STAT(cache_hit, uint64_t, "u", "Cache hits") -MAC_STAT(cache_miss, uint64_t, "u", "Cache misses") +MAC_STAT(cache_hit, uint64_t, "u", "Cache hits") +MAC_STAT(cache_miss, uint64_t, "u", "Cache misses") -MAC_STAT(backend_conn, uint64_t, "u", "Backend connections initiated") -MAC_STAT(backend_req, uint64_t, "u", "Backend requests sent") +MAC_STAT(backend_conn, uint64_t, "u", "Backend connections initiated") +MAC_STAT(backend_recycle, uint64_t, "u", "Backend connections recyles")