r244 - in trunk/varnish-cache: bin/varnishd include

phk at projects.linpro.no phk at projects.linpro.no
Wed Jun 28 11:39:25 CEST 2006


Author: phk
Date: 2006-06-28 11:39:25 +0200 (Wed, 28 Jun 2006)
New Revision: 244

Modified:
   trunk/varnish-cache/bin/varnishd/cache_acceptor.c
   trunk/varnish-cache/bin/varnishd/cache_backend.c
   trunk/varnish-cache/bin/varnishd/cache_pool.c
   trunk/varnish-cache/include/stat_field.h
Log:
More stats counters


Modified: trunk/varnish-cache/bin/varnishd/cache_acceptor.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/cache_acceptor.c	2006-06-28 09:21:15 UTC (rev 243)
+++ trunk/varnish-cache/bin/varnishd/cache_acceptor.c	2006-06-28 09:39:25 UTC (rev 244)
@@ -122,7 +122,7 @@
 	char port[10];
 	int i;
 
-	VSL_stats->cli_conn++;
+	VSL_stats->client_conn++;
 
 	(void)arg;
 	sm = calloc(sizeof *sm, 1);

Modified: trunk/varnish-cache/bin/varnishd/cache_backend.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/cache_backend.c	2006-06-28 09:21:15 UTC (rev 243)
+++ trunk/varnish-cache/bin/varnishd/cache_backend.c	2006-06-28 09:39:25 UTC (rev 244)
@@ -239,6 +239,7 @@
 		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 @@
 	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);

Modified: trunk/varnish-cache/bin/varnishd/cache_pool.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/cache_pool.c	2006-06-28 09:21:15 UTC (rev 243)
+++ trunk/varnish-cache/bin/varnishd/cache_pool.c	2006-06-28 09:39:25 UTC (rev 244)
@@ -31,10 +31,13 @@
 
 	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 @@
 		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));

Modified: trunk/varnish-cache/include/stat_field.h
===================================================================
--- trunk/varnish-cache/include/stat_field.h	2006-06-28 09:21:15 UTC (rev 243)
+++ trunk/varnish-cache/include/stat_field.h	2006-06-28 09:39:25 UTC (rev 244)
@@ -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")
 




More information about the varnish-commit mailing list