[master] 2a0de6d8b vsc: Introduce MAIN.s_bgfetch

Dridi Boukelmoune dridi.boukelmoune at gmail.com
Wed Dec 2 10:43:10 UTC 2020


commit 2a0de6d8bb040624d80e5c16ce5f93b856921e2c
Author: Dridi Boukelmoune <dridi.boukelmoune at gmail.com>
Date:   Fri Nov 27 16:04:06 2020 +0100

    vsc: Introduce MAIN.s_bgfetch

diff --git a/bin/varnishd/VSC_main.vsc b/bin/varnishd/VSC_main.vsc
index 4bede0a9a..b99ca8c2a 100644
--- a/bin/varnishd/VSC_main.vsc
+++ b/bin/varnishd/VSC_main.vsc
@@ -434,6 +434,12 @@
 	:group: wrk
 	:oneliner:	Total backend fetches initiated
 
+	Total backend fetches initiated, including background fetches.
+
+.. varnish_vsc:: s_bgfetch
+	:group: wrk
+	:oneliner:	Total backend background fetches initiated
+
 
 .. varnish_vsc:: s_synth
 	:group: wrk
diff --git a/bin/varnishd/cache/cache_req_fsm.c b/bin/varnishd/cache/cache_req_fsm.c
index a80d9ea30..7c4e7c036 100644
--- a/bin/varnishd/cache/cache_req_fsm.c
+++ b/bin/varnishd/cache/cache_req_fsm.c
@@ -597,6 +597,8 @@ cnt_lookup(struct worker *wrk, struct req *req)
 			CHECK_OBJ_NOTNULL(busy->boc, BOC_MAGIC);
 			// XXX: shouldn't we go to miss?
 			VBF_Fetch(wrk, req, busy, oc, VBF_BACKGROUND);
+			wrk->stats->s_fetch++;
+			wrk->stats->s_bgfetch++;
 		} else {
 			(void)VRB_Ignore(req);// XXX: handle err
 		}


More information about the varnish-commit mailing list