[experimental-ims] 8a22dbf Account for all attempted fetches.

Poul-Henning Kamp phk at FreeBSD.org
Thu Dec 18 10:27:46 CET 2014


commit 8a22dbf5d181eb125ea4652af7317cc41725969a
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date:   Thu May 3 08:10:55 2012 +0000

    Account for all attempted fetches.
    
    Update some VSC descriptions while at it.

diff --git a/bin/varnishd/cache/cache_center.c b/bin/varnishd/cache/cache_center.c
index cec3ddb..e343aa8 100644
--- a/bin/varnishd/cache/cache_center.c
+++ b/bin/varnishd/cache/cache_center.c
@@ -576,6 +576,8 @@ cnt_fetch(struct sess *sp, struct worker *wrk, struct req *req)
 
 	need_host_hdr = !http_GetHdr(bo->bereq, H_Host, NULL);
 
+	wrk->acct_tmp.fetch++;
+
 	i = FetchHdr(sp, need_host_hdr, req->objcore == NULL);
 	/*
 	 * If we recycle a backend connection, there is a finite chance
@@ -902,7 +904,6 @@ cnt_fetchbody(struct sess *sp, struct worker *wrk, struct req *req)
 		HSH_Ref(req->obj->objcore);
 
 	VBO_DerefBusyObj(wrk, &req->busyobj);
-	wrk->acct_tmp.fetch++;
 	sp->step = STP_PREPRESP;
 	return (0);
 }
diff --git a/include/tbl/vsc_f_main.h b/include/tbl/vsc_f_main.h
index bc79d5b..c3fd288 100644
--- a/include/tbl/vsc_f_main.h
+++ b/include/tbl/vsc_f_main.h
@@ -147,53 +147,57 @@ VSC_F(backend_retry,		uint64_t, 0, 'a',
 	""
 )
 
-VSC_F(fetch_head,		uint64_t, 1, 'a',
-    "Fetch head",
-	""
+/*---------------------------------------------------------------------
+ * Backend fetch statistics
+ */
+
+VSC_F(fetch_head,		uint64_t, 1, 'c',
+    "Fetch no body (HEAD)",
+	"beresp with no body because the request is HEAD."
 )
-VSC_F(fetch_length,		uint64_t, 1, 'a',
+VSC_F(fetch_length,		uint64_t, 1, 'c',
     "Fetch with Length",
-	""
+	"beresp with Content-Length."
 )
-VSC_F(fetch_chunked,		uint64_t, 1, 'a',
+VSC_F(fetch_chunked,		uint64_t, 1, 'c',
     "Fetch chunked",
-	""
+	"beresp with Chunked."
 )
-VSC_F(fetch_eof,		uint64_t, 1, 'a',
+VSC_F(fetch_eof,		uint64_t, 1, 'c',
     "Fetch EOF",
-	""
+	"beresp with EOF from lack of other info."
 )
-VSC_F(fetch_bad,		uint64_t, 1, 'a',
-    "Fetch had bad headers",
-	""
+VSC_F(fetch_bad,		uint64_t, 1, 'c',
+    "Fetch bad T-E",
+	"beresp failed due to unknown Transfer-Encoding."
 )
-VSC_F(fetch_close,		uint64_t, 1, 'a',
+VSC_F(fetch_close,		uint64_t, 1, 'c',
     "Fetch wanted close",
-	""
+	"beresp with EOF due to Connection: Close."
 )
-VSC_F(fetch_oldhttp,		uint64_t, 1, 'a',
+VSC_F(fetch_oldhttp,		uint64_t, 1, 'c',
     "Fetch pre HTTP/1.1 closed",
-	""
-)
-VSC_F(fetch_zero,		uint64_t, 1, 'a',
-    "Fetch zero len",
-	""
+	"beresp with EOF due to HTTP < 1.1"
 )
-VSC_F(fetch_failed,		uint64_t, 1, 'a',
-    "Fetch failed",
-	""
+VSC_F(fetch_zero,		uint64_t, 1, 'c',
+    "Fetch zero len body",
+	"beresp with EOF due to keep-live but neither Chunked or Len."
 )
-VSC_F(fetch_1xx,		uint64_t, 1, 'a',
+VSC_F(fetch_1xx,		uint64_t, 1, 'c',
     "Fetch no body (1xx)",
-	""
+	"beresp with no body because of 1XX response."
 )
-VSC_F(fetch_204,		uint64_t, 1, 'a',
+VSC_F(fetch_204,		uint64_t, 1, 'c',
     "Fetch no body (204)",
-	""
+	"beresp with no body because of 204 response."
 )
-VSC_F(fetch_304,		uint64_t, 1, 'a',
+VSC_F(fetch_304,		uint64_t, 1, 'c',
     "Fetch no body (304)",
-	""
+	"beresp with no body because of 304 response."
+)
+VSC_F(fetch_failed,		uint64_t, 1, 'c',
+    "Fetch body failed",
+	"beresp body fetch failed."
 )
 
 /*---------------------------------------------------------------------



More information about the varnish-commit mailing list