[master] e4072d3 Count number of times we go through vcl_error

Tollef Fog Heen tfheen at varnish-cache.org
Mon Mar 11 14:00:54 CET 2013


commit e4072d36821a882bac743b2f6bee132315332311
Author: Tollef Fog Heen <tfheen at varnish-software.com>
Date:   Mon Mar 11 13:57:49 2013 +0100

    Count number of times we go through vcl_error

diff --git a/bin/varnishd/cache/cache_req_fsm.c b/bin/varnishd/cache/cache_req_fsm.c
index 3a15f58..b2bdd50 100644
--- a/bin/varnishd/cache/cache_req_fsm.c
+++ b/bin/varnishd/cache/cache_req_fsm.c
@@ -267,6 +267,7 @@ cnt_error(struct worker *wrk, struct req *req)
 	AZ(req->obj);
 	AZ(req->busyobj);
 
+	req->acct_req.error++;
 	bo = VBO_GetBusyObj(wrk, req);
 	req->busyobj = bo;
 	AZ(bo->stats);
diff --git a/bin/varnishtest/tests/b00017.vtc b/bin/varnishtest/tests/b00017.vtc
index 9edcbc5..85ec39c 100644
--- a/bin/varnishtest/tests/b00017.vtc
+++ b/bin/varnishtest/tests/b00017.vtc
@@ -15,3 +15,5 @@ client c1 {
 	expect resp.status == 888
 	expect resp.http.connection == close
 } -run
+
+varnish v1 -expect s_error == 1
diff --git a/include/tbl/acct_fields.h b/include/tbl/acct_fields.h
index 3dc1ff6..1184240 100644
--- a/include/tbl/acct_fields.h
+++ b/include/tbl/acct_fields.h
@@ -35,5 +35,6 @@ ACCT(req)
 ACCT(pipe)
 ACCT(pass)
 ACCT(fetch)
+ACCT(error)
 ACCT(hdrbytes)
 ACCT(bodybytes)
diff --git a/include/tbl/vsc_f_main.h b/include/tbl/vsc_f_main.h
index f487471..3f6d3fe 100644
--- a/include/tbl/vsc_f_main.h
+++ b/include/tbl/vsc_f_main.h
@@ -370,6 +370,10 @@ VSC_F(s_fetch,			uint64_t, 1, 'a',
     "Total fetch",
 	""
 )
+VSC_F(s_error,			uint64_t, 1, 'a',
+    "Total error",
+	""
+)
 VSC_F(s_hdrbytes,		uint64_t, 1, 'a',
     "Total header bytes",
 	""



More information about the varnish-commit mailing list