]> err.no Git - varnish/commitdiff
More stats counters
authorphk <phk@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Wed, 28 Jun 2006 09:39:25 +0000 (09:39 +0000)
committerphk <phk@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Wed, 28 Jun 2006 09:39:25 +0000 (09:39 +0000)
git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@244 d4fa192b-c00b-0410-8231-f00ffab90ce4

varnish-cache/bin/varnishd/cache_acceptor.c
varnish-cache/bin/varnishd/cache_backend.c
varnish-cache/bin/varnishd/cache_pool.c
varnish-cache/include/stat_field.h

index a3944587d015cc41281708cc157b73f2646dfc5b..d1cac276cf0112d386ca01188a9d3b0e1b6847ed 100644 (file)
@@ -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);
index 15965e8c2e200a094e37dfcde1e7cfa5cb3fd2b9..951bdfb0e4502f9b05f5f9941db21fdc06989eab 100644 (file)
@@ -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);
index 34834b5ef5fc4f256ec10fefa6cd782520c8df25..4699a3d854a849c4ee9dafba5985db10cca72fa9 100644 (file)
@@ -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));
index 97202b5f110af17f5ab8125df19803b4c66cc240..74948271ea8afa54634171579a02d481fe2f8ffc 100644 (file)
@@ -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")