Commit d560c76f authored by Geoff Simmons's avatar Geoff Simmons

Add the stats PESI.esidata_activate and .esidata_vdp.

These should *always* match. If not, then there is indeed a race
with respect to the attribute's value at activate() and VDP init times.
parent 03fdfd18
......@@ -12,4 +12,16 @@
Number of times no threads were available for parallel ESI.
.. varnish_vsc:: esidata_activate
:type: counter
:oneliner: Object attribute ESIDATA set in activate()
Number of times the ESIDATA attribute was true on actvate() calls
.. varnish_vsc:: esidata_vdp
:type: counter
:oneliner: Object attribute ESIDATA set in VDP init
Number of times the ESIDATA attribute was true at VDP init time
.. varnish_vsc_end:: pesi
......@@ -101,6 +101,8 @@ client c1 {
client c1 -run
varnish v1 -expect esi_errors == 0
varnish v1 -expect MAIN.s_resp_bodybytes == 150
varnish v1 -expect PESI.esidata_activate > 0
varnish v1 -expect PESI.esidata_vdp > 0
delay 1
logexpect l1 -v v1 -d 1 -g vxid -q "vxid == 1001" {
......
......@@ -52,6 +52,7 @@
#include "debug.h"
#include "vdp_pesi.h"
#include "VSC_pesi.h"
#include "node.h"
#include "node_assert.h"
#include "pesi.h"
......@@ -60,6 +61,9 @@
#include "misc.h"
/* in pesi.c */
extern struct VSC_pesi *stats;
/*lint -esym(843, block_final, front_push)
* we want to keep the option to tune these at runtime in a debugger
*/
......@@ -659,10 +663,14 @@ vdp_pesi_init(struct vdp_ctx *vdc, void **priv, struct objcore *oc)
struct pecx *pecx;
struct pesi_tree *pesi_tree;
struct node *root_node;
int activated;
CHECK_OBJ_NOTNULL(vdc, VDP_CTX_MAGIC);
CHECK_OBJ_ORNULL(oc, OBJCORE_MAGIC);
if (oc == NULL || !ObjHasAttr(vdc->wrk, oc, OA_ESIDATA))
activated = (oc != NULL && ObjHasAttr(vdc->wrk, oc, OA_ESIDATA));
if (activated)
stats->esidata_vdp++;
else
return (1);
req = vdc->req;
......
......@@ -221,6 +221,9 @@ pesi_resp_default_filter_list(void *arg, struct vsb *vsb)
ObjHasAttr(req->wrk, req->objcore, OA_ESIDATA) */)
VSB_cat(vsb, " pesi");
if (ObjHasAttr(req->wrk, req->objcore, OA_ESIDATA))
stats->esidata_activate++;
if (cache_param->http_gzip_support &&
ObjCheckFlag(req->wrk, req->objcore, OF_GZIPED) &&
!RFC2616_Req_Gzip(req->http))
......
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