Commit 2f057a32 authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

Report VFP statistics in their own suppressed SLT_VfpAcct until we know

what we really want with them.
parent dfc78bfa
......@@ -118,9 +118,12 @@ VFP_Close(struct vfp_ctx *vc)
{
struct vfp_entry *vfe;
VTAILQ_FOREACH(vfe, &vc->vfp, list)
VTAILQ_FOREACH(vfe, &vc->vfp, list) {
if(vfe->vfp->fini != NULL)
vfe->vfp->fini(vc, vfe);
VSLb(vc->vsl, SLT_VfpAcct, "%s %ju %ju",
vfe->vfp->name, vfe->calls, vfe->bytes_out);
}
}
int
......@@ -131,6 +134,7 @@ VFP_Open(struct vfp_ctx *vc)
CHECK_OBJ_NOTNULL(vc, VFP_CTX_MAGIC);
CHECK_OBJ_NOTNULL(vc->http, HTTP_MAGIC);
AN(vc->vsl);
VTAILQ_FOREACH_REVERSE(vfe, &vc->vfp, vfp_entry_s, list) {
if (vfe->vfp->init == NULL)
continue;
......@@ -142,6 +146,7 @@ VFP_Open(struct vfp_ctx *vc)
return (-1);
}
}
return (0);
}
......@@ -175,13 +180,13 @@ VFP_Suck(struct vfp_ctx *vc, void *p, ssize_t *lp)
vp = VFP_ERROR;
}
vfe->closed = vp;
vfe->calls++;
vfe->bytes_out += *lp;
} else {
/* Already closed filter */
*lp = 0;
vp = vfe->closed;
}
vfe->calls++;
vfe->bytes_out = *lp;
vc->vfp_nxt = vfe;
return (vp);
}
......
......@@ -130,6 +130,7 @@ tweak_vsl_mask(struct vsb *vsb, const struct parspec *par, const char *arg)
(void)bit(mgt_param.vsl_mask, SLT_VCL_trace, BSET);
(void)bit(mgt_param.vsl_mask, SLT_WorkThread, BSET);
(void)bit(mgt_param.vsl_mask, SLT_Hash, BSET);
(void)bit(mgt_param.vsl_mask, SLT_VfpAcct, BSET);
} else {
return (bit_tweak(vsb, mgt_param.vsl_mask,
SLT__Reserved, arg, VSL_tags,
......
......@@ -23,6 +23,7 @@ varnish v1 \
} -start
varnish v1 -cliok "param.set fetch_chunksize 4k"
varnish v1 -cliok "param.set vsl_mask +VfpAcct"
client c1 {
txreq -url /foo -hdr "Accept-Encoding: gzip"
......
......@@ -499,4 +499,16 @@ SLTM(BereqAcct, 0, "Backend request accounting",
"\n"
)
SLTM(VfpAcct, 0, "Fetch filter accounting",
"Contains name of VFP and statistics.\n\n"
"The format is::\n\n"
"\t%s %d %d\n"
"\t| | |\n"
"\t| | +- Total bytes produced\n"
"\t| +---- Number of calls made\n"
"\t+------- Name of filter\n"
"\n"
NODEF_NOTICE
)
#undef NODEF_NOTICE
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