Commit ea640d47 authored by AlveElde's avatar AlveElde Committed by Dridi Boukelmoune

expire: Add hits to EXP_Expired log statement

This makes it easier to estimate the popularity of expired objects.
parent 796a645b
......@@ -354,8 +354,9 @@ exp_expire(struct exp_priv *ep, vtim_real now)
assert(oc->timer_idx == VBH_NOIDX);
CHECK_OBJ_NOTNULL(oc->objhead, OBJHEAD_MAGIC);
VSLb(&ep->vsl, SLT_ExpKill, "EXP_Expired xid=%ju t=%.0f",
VXID(ObjGetXID(ep->wrk, oc)), EXP_Ttl(NULL, oc) - now);
VSLb(&ep->vsl, SLT_ExpKill, "EXP_Expired x=%ju t=%.0f h=%ld",
VXID(ObjGetXID(ep->wrk, oc)), EXP_Ttl(NULL, oc) - now,
oc->hits);
ObjSendEvent(ep->wrk, oc, OEV_EXPIRE);
(void)HSH_DerefObjCore(ep->wrk, &oc, 0);
}
......
......@@ -21,7 +21,7 @@ varnish v1 -vcl+backend {
varnish v1 -cliok "param.set timeout_idle 2"
logexpect l0 -v v1 -g raw {
expect * 0 ExpKill "EXP_Expired xid=1002"
expect * 0 ExpKill "EXP_Expired x=1002"
} -start
logexpect l2 -v v1 -g raw {
......@@ -109,4 +109,4 @@ varnish v1 -errvcl "Not available in subroutine 'vcl_backend_response'" {
sub vcl_backend_response {
if (bereq.url == "response") { purge.hard(); }
}
}
\ No newline at end of file
}
......@@ -367,7 +367,7 @@ SLTM(ExpKill, 0, "Object expiry event",
"\tEXP_Inbox p=%p e=%f f=0x%x\n"
"\tEXP_Kill p=%p e=%f f=0x%x\n"
"\tEXP_When p=%p e=%f f=0x%x\n"
"\tEXP_Expired x=%u t=%f\n"
"\tEXP_Expired x=%u t=%f h=%u\n"
"\tLRU_Cand p=%p f=0x%x r=%d\n"
"\tLRU x=%u\n"
"\tLRU_Fail\n"
......@@ -380,6 +380,7 @@ SLTM(ExpKill, 0, "Object expiry event",
"\tf=0x%x Objcore flags\n"
"\tr=%d Objcore refcount\n"
"\tx=%u Object VXID\n"
"\th=%u Objcore hits\n"
"\n"
)
......
......@@ -68,7 +68,7 @@ logexpect l2 -v v1 -q "Begin ~ bgfetch" {
} -start
logexpect l3 -v v1 -g raw -q "vxid == 0" {
expect * * ExpKill xid=1008
expect * * ExpKill x=1008
} -start
client c1 {
......
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