r5095 - in trunk/varnish-cache: bin/varnishd bin/varnishstat include

phk at varnish-cache.org phk at varnish-cache.org
Wed Aug 11 22:52:20 CEST 2010


Author: phk
Date: 2010-08-11 22:52:20 +0200 (Wed, 11 Aug 2010)
New Revision: 5095

Modified:
   trunk/varnish-cache/bin/varnishd/cache_backend.c
   trunk/varnish-cache/bin/varnishd/cache_backend_cfg.c
   trunk/varnish-cache/bin/varnishd/cache_backend_poll.c
   trunk/varnish-cache/bin/varnishstat/varnishstat_curses.c
   trunk/varnish-cache/include/vsc_fields.h
Log:
Add another per-backend variable to show the happy health-probe bitmap.

Add cheesy display of same in varnishstat curses mode:

          16         0.00         1.00 uptime - Client uptime
           1          .            .   VBE.fs(192.168.60.20,,80).vcls - VCL references
  0000000000 <____VVVVVVVVVVVVVVVVVVVV VBE.fs(192.168.60.20,,80).happy - Happy health probes
  top bits    bottom bits one-by-one

We need to start thinking about how to structure varnishstat output...


Modified: trunk/varnish-cache/bin/varnishd/cache_backend.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/cache_backend.c	2010-08-11 20:08:29 UTC (rev 5094)
+++ trunk/varnish-cache/bin/varnishd/cache_backend.c	2010-08-11 20:52:20 UTC (rev 5095)
@@ -430,7 +430,6 @@
 
 	if (strcmp(vdi->name, "simple"))
 		return;
-	printf("USE HEALTH %p\n", vdi);
 	CAST_OBJ_NOTNULL(vs, vdi->priv, VDI_SIMPLE_MAGIC);
 	if (vs->vrt->probe == NULL)
 		return;

Modified: trunk/varnish-cache/bin/varnishd/cache_backend_cfg.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/cache_backend_cfg.c	2010-08-11 20:08:29 UTC (rev 5094)
+++ trunk/varnish-cache/bin/varnishd/cache_backend_cfg.c	2010-08-11 20:52:20 UTC (rev 5095)
@@ -102,7 +102,6 @@
 	int i;
 	struct vbc *vbe, *vbe2;
 
-	ASSERT_CLI();
 	CHECK_OBJ_NOTNULL(b, BACKEND_MAGIC);
 	assert(b->refcount > 0);
 

Modified: trunk/varnish-cache/bin/varnishd/cache_backend_poll.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/cache_backend_poll.c	2010-08-11 20:08:29 UTC (rev 5094)
+++ trunk/varnish-cache/bin/varnishd/cache_backend_poll.c	2010-08-11 20:52:20 UTC (rev 5095)
@@ -101,11 +101,6 @@
 
 static struct lock			vbp_mtx;
 
-static const char default_request[] =
-    "GET / HTTP/1.1\r\n"
-    "Connection: close\r\n"
-    "\r\n";
-
 /*--------------------------------------------------------------------
  * Poke one backend, once, but possibly at both IPv4 and IPv6 addresses.
  *
@@ -303,6 +298,7 @@
 	    vt->backend->vcl_name, logmsg, bits,
 	    vt->good, vt->probe.threshold, vt->probe.window,
 	    vt->last, vt->avg, vt->resp_buf);
+	vt->backend->vsc->happy = vt->happy;
 }
 
 /*--------------------------------------------------------------------
@@ -451,8 +447,6 @@
 	 * Sanitize and insert defaults
 	 * XXX: we could make these defaults parameters
 	 */
-	if (vcl->probe.request == NULL)
-		vcl->probe.request = default_request;
 	if (vcl->probe.timeout == 0.0)
 		vcl->probe.timeout = 2.0;
 	if (vcl->probe.interval == 0.0)

Modified: trunk/varnish-cache/bin/varnishstat/varnishstat_curses.c
===================================================================
--- trunk/varnish-cache/bin/varnishstat/varnishstat_curses.c	2010-08-11 20:08:29 UTC (rev 5094)
+++ trunk/varnish-cache/bin/varnishstat/varnishstat_curses.c	2010-08-11 20:52:20 UTC (rev 5095)
@@ -215,6 +215,15 @@
 					    ju, (ju - (intmax_t)pt->ref)/lt,
 					    ju / up, pt->name));
 					pt->ref = ju;
+				} else if (pt->type == 'b') {
+					AC(mvprintw(line, 0, "  %010.10jx <",
+					    (ju >> 24) & 0xffffffffffLL));
+					for (ch = 0x800000; ch; ch >>= 1)
+						if (ju & ch)	
+							AC(printw("V"));
+						else
+							AC(printw("_"));
+					AC(printw(" %s", pt->name));
 				} else {
 					AC(mvprintw(line, 0,
 					    "%12ju %12s %12s %s\n",

Modified: trunk/varnish-cache/include/vsc_fields.h
===================================================================
--- trunk/varnish-cache/include/vsc_fields.h	2010-08-11 20:08:29 UTC (rev 5094)
+++ trunk/varnish-cache/include/vsc_fields.h	2010-08-11 20:52:20 UTC (rev 5095)
@@ -193,6 +193,7 @@
 #endif
 
 VSC_F_VBE(vcls,			uint64_t, 0, 'i', "VCL references")
+VSC_F_VBE(happy,		uint64_t, 0, 'b', "Happy health probes")
 
 #ifdef __VSC_F_VBE
 #undef VSC_F_VBE




More information about the varnish-commit mailing list