Commit f67927b5 authored by Geoff Simmons's avatar Geoff Simmons

Introduce VSC stat cache_hitmiss, to count hits on hit-for-miss.

parent 939e685d
......@@ -440,6 +440,7 @@ HSH_Lookup(struct req *req, struct objcore **ocp, struct objcore **bocp,
wrk->stats->cache_hitpass++;
oc = NULL;
} else if (oc->flags & OC_F_PASS) {
wrk->stats->cache_hitmiss++;
oc = NULL;
*bocp = hsh_insert_busyobj(wrk, oh);
} else {
......@@ -462,7 +463,7 @@ HSH_Lookup(struct req *req, struct objcore **ocp, struct objcore **bocp,
}
if (exp_oc != NULL && exp_oc->flags & OC_F_PASS) {
wrk->stats->cache_hitpass++;
wrk->stats->cache_hitmiss++;
exp_oc = NULL;
busy_found = 0;
}
......
......@@ -44,4 +44,5 @@ client c2 {
client c1 -wait
varnish v1 -expect cache_hitpass == 0
varnish v1 -expect cache_hitmiss == 1
varnish v1 -expect cache_miss == 2
......@@ -47,3 +47,4 @@ client c1 {
varnish v1 -expect MAIN.cache_hitpass == 1
varnish v1 -expect MAIN.cache_miss == 2
varnish v1 -expect MAIN.cache_hitmiss == 0
......@@ -30,4 +30,5 @@ client c1 {
} -run
varnish v1 -expect cache_hitpass == 0
varnish v1 -expect cache_hitmiss == 2
varnish v1 -expect cache_miss == 3
......@@ -99,6 +99,15 @@ VSC_FF(cache_hitpass, uint64_t, 1, 'c', 'i', info,
" decision is being used."
)
VSC_FF(cache_hitmiss, uint64_t, 1, 'c', 'i', info,
"Cache hits for miss.",
"Count of hits for miss."
" A cache hit for miss indicates that Varnish is going to"
" proceed as for a cache miss without request coalescing, and"
" this decision has been cached. This counts how many times the"
" cached decision is being used."
)
VSC_FF(cache_miss, uint64_t, 1, 'c', 'i', info,
"Cache misses",
"Count of misses."
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment