[master] 3dbbcaf Move VBE stats to New World Order

Poul-Henning Kamp phk at FreeBSD.org
Tue May 23 14:11:06 CEST 2017


commit 3dbbcaf09dcbb532ca90bcb60dd4e2f93f1d2af7
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date:   Tue May 23 12:09:02 2017 +0000

    Move VBE stats to New World Order

diff --git a/bin/varnishd/Makefile.am b/bin/varnishd/Makefile.am
index 5586cf4..9afd301 100644
--- a/bin/varnishd/Makefile.am
+++ b/bin/varnishd/Makefile.am
@@ -236,3 +236,14 @@ $(varnishd_OBJECTS):	VSC_lck.h
 EXTRA_DIST	+=	lck.vsc
 DISTCLEANFILES	+=	VSC_lck.c VSC_lck.h
 nodist_varnishd_SOURCES +=	VSC_lck.c
+
+#######################################################################
+
+VSC_vbe.c VSC_vbe.h: $(srcdir)/vbe.vsc $(top_builddir)/lib/libvcc/vsctool.py
+	$(PYTHON) $(top_srcdir)/lib/libvcc/vsctool.py $(srcdir)/vbe.vsc
+
+$(varnishd_OBJECTS):	VSC_vbe.h
+
+EXTRA_DIST	+=	vbe.vsc
+DISTCLEANFILES	+=	VSC_vbe.c VSC_vbe.h
+nodist_varnishd_SOURCES +=	VSC_vbe.c
diff --git a/bin/varnishd/cache/cache_backend.c b/bin/varnishd/cache/cache_backend.c
index 3e7ecdb..d9759d8 100644
--- a/bin/varnishd/cache/cache_backend.c
+++ b/bin/varnishd/cache/cache_backend.c
@@ -45,6 +45,8 @@
 #include "cache_transport.h"
 #include "http1/cache_http1.h"
 
+#include "VSC_vbe.h"
+
 #define FIND_TMO(tmx, dst, bo, be)					\
 	do {								\
 		CHECK_OBJ_NOTNULL(bo, BUSYOBJ_MAGIC);			\
diff --git a/bin/varnishd/cache/cache_backend.h b/bin/varnishd/cache/cache_backend.h
index 0bc73ed..da5ffdc 100644
--- a/bin/varnishd/cache/cache_backend.h
+++ b/bin/varnishd/cache/cache_backend.h
@@ -67,7 +67,7 @@ struct backend {
 	const char		*admin_health;
 	double			health_changed;
 
-	struct VSC_C_vbe	*vsc;
+	struct VSC_vbe		*vsc;
 
 	struct tcp_pool		*tcp_pool;
 
diff --git a/bin/varnishd/cache/cache_backend_cfg.c b/bin/varnishd/cache/cache_backend_cfg.c
index e4acf8a..0b31cef 100644
--- a/bin/varnishd/cache/cache_backend_cfg.c
+++ b/bin/varnishd/cache/cache_backend_cfg.c
@@ -46,6 +46,8 @@
 #include "cache_director.h"
 #include "cache_backend.h"
 
+#include "VSC_vbe.h"
+
 static VTAILQ_HEAD(, backend) backends = VTAILQ_HEAD_INITIALIZER(backends);
 static VTAILQ_HEAD(, backend) cool_backends =
     VTAILQ_HEAD_INITIALIZER(cool_backends);
@@ -174,8 +176,7 @@ VBE_Event(struct backend *be, enum vcl_event_e ev)
 	CHECK_OBJ_NOTNULL(be, BACKEND_MAGIC);
 
 	if (ev == VCL_EVENT_WARM) {
-		be->vsc = VSM_Alloc(sizeof *be->vsc,
-		    VSC_CLASS, VSC_type_vbe, be->display_name);
+		be->vsc = VSC_vbe_New(be->display_name);
 		AN(be->vsc);
 	}
 
diff --git a/bin/varnishd/cache/cache_backend_probe.c b/bin/varnishd/cache/cache_backend_probe.c
index c3cfd8c..af3336d 100644
--- a/bin/varnishd/cache/cache_backend_probe.c
+++ b/bin/varnishd/cache/cache_backend_probe.c
@@ -53,6 +53,8 @@
 #include "cache_director.h"
 #include "cache_backend.h"
 
+#include "VSC_vbe.h"
+
 /* Default averaging rate, we want something pretty responsive */
 #define AVG_RATE			4
 
diff --git a/bin/varnishd/http1/cache_http1.h b/bin/varnishd/http1/cache_http1.h
index f3591127..8b4c592 100644
--- a/bin/varnishd/http1/cache_http1.h
+++ b/bin/varnishd/http1/cache_http1.h
@@ -27,6 +27,8 @@
  *
  */
 
+struct VSC_vbe;
+
 /* cache_http1_fetch.c [V1F] */
 int V1F_SendReq(struct worker *, struct busyobj *, uint64_t *ctr,
     int onlycached);
@@ -49,7 +51,7 @@ struct v1p_acct {
 };
 
 void V1P_Process(struct req *, int fd, struct v1p_acct *);
-void V1P_Charge(struct req *, const struct v1p_acct *, struct VSC_C_vbe *);
+void V1P_Charge(struct req *, const struct v1p_acct *, struct VSC_vbe *);
 
 /* cache_http1_line.c */
 void V1L_Chunked(const struct worker *w);
diff --git a/bin/varnishd/http1/cache_http1_pipe.c b/bin/varnishd/http1/cache_http1_pipe.c
index b6a2e30..49a10e5 100644
--- a/bin/varnishd/http1/cache_http1_pipe.c
+++ b/bin/varnishd/http1/cache_http1_pipe.c
@@ -38,6 +38,8 @@
 
 #include "cache_http1.h"
 
+#include "VSC_vbe.h"
+
 static struct lock pipestat_mtx;
 
 static int
@@ -61,7 +63,7 @@ rdf(int fd0, int fd1, uint64_t *pcnt)
 }
 
 void
-V1P_Charge(struct req *req, const struct v1p_acct *a, struct VSC_C_vbe *b)
+V1P_Charge(struct req *req, const struct v1p_acct *a, struct VSC_vbe *b)
 {
 
 	AN(b);
diff --git a/bin/varnishd/vbe.vsc b/bin/varnishd/vbe.vsc
new file mode 100644
index 0000000..f959ca9
--- /dev/null
+++ b/bin/varnishd/vbe.vsc
@@ -0,0 +1,76 @@
+..
+	This is *NOT* a RST file but the syntax has been chosen so
+	that it may become an RST file at some later date.
+
+	XXX: For now this file must be kept in 100% agreement with
+	XXX: include/tbl/vsc_fields.h
+
+.. varnish_vsc_begin::	vbe
+	:oneliner:	BACKEND COUNTERS (VBE.*)
+
+.. varnish_vsc:: happy
+	:type:	bitmap
+	:level:	info
+	:oneliner:	Happy health probes
+
+.. varnish_vsc:: bereq_hdrbytes
+	:type:	counter
+	:level:	info
+	:oneliner:	Request header bytes
+
+Total backend request header bytes sent
+
+.. varnish_vsc:: bereq_bodybytes
+	:type:	counter
+	:level:	info
+	:oneliner:	Request body bytes
+
+Total backend request body bytes sent
+
+.. varnish_vsc:: beresp_hdrbytes
+	:type:	counter
+	:level:	info
+	:oneliner:	Response header bytes
+
+Total backend response header bytes received
+
+.. varnish_vsc:: beresp_bodybytes
+	:type:	counter
+	:level:	info
+	:oneliner:	Response body bytes
+
+Total backend response body bytes received
+
+.. varnish_vsc:: pipe_hdrbytes
+	:type:	counter
+	:level:	info
+	:oneliner:	Pipe request header bytes
+
+Total request bytes sent for piped sessions
+
+.. varnish_vsc:: pipe_out
+	:type:	counter
+	:level:	info
+	:oneliner:	Piped bytes to backend
+
+Total number of bytes forwarded to backend in pipe sessions
+
+.. varnish_vsc:: pipe_in
+	:type:	counter
+	:level:	info
+	:oneliner:	Piped bytes from backend
+
+Total number of bytes forwarded from backend in pipe sessions
+
+.. varnish_vsc:: conn
+	:type:	gauge
+	:level:	info
+	:oneliner:	Concurrent connections to backend
+
+.. varnish_vsc:: req
+	:type:	counter
+	:level:	info
+	:oneliner:	Backend requests sent
+
+.. varnish_vsc_end::	vbe
+



More information about the varnish-commit mailing list