by keeping the current requests accounting stats in the worker thread.
For reasons which will be explained in the next commit, this is no
longer a good idea, and this commit moves these counters from
the worker thread to the session at a slight but all in all
trivial cost in memory footprint.
Remove the call to SES_Charge() when we hit a busy object, it is
not necessary to clean the worker thread counters here now.
Move these counters from the worker thread to the see
git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@3512
d4fa192b-c00b-0410-8231-
f00ffab90ce4
struct VCL_conf *vcl;
struct srcaddr *srcaddr;
- struct acct acct;
unsigned char *wlb, *wlp, *wle;
unsigned wlr;
struct workreq workreq;
struct acct acct;
+ struct acct acct_req;
/* pointers to hash string components */
unsigned nhashptr;
EXP_Insert(sp->obj);
HSH_Unbusy(sp);
}
- sp->wrk->acct.fetch++;
+ sp->acct_req.fetch++;
sp->step = STP_DELIVER;
return (0);
}
/* Receive a HTTP protocol request */
HTC_Init(sp->htc, sp->ws, sp->fd);
sp->wrk->lastused = sp->t_open;
- sp->wrk->acct.sess++;
+ sp->acct_req.sess++;
SES_RefSrcAddr(sp);
do
i = HTC_Rx(sp->htc);
if (params->diag_bitmap & 0x20)
WSP(sp, SLT_Debug,
"on waiting list <%s>", sp->objhead->hash);
- SES_Charge(sp);
return (1);
}
return (0);
}
assert(sp->handling == VCL_RET_PASS);
- sp->wrk->acct.pass++;
+ sp->acct_req.pass++;
HSH_Prealloc(sp);
sp->obj = sp->wrk->nobj;
sp->wrk->nobj = NULL;
CHECK_OBJ_NOTNULL(sp, SESS_MAGIC);
CHECK_OBJ_NOTNULL(sp->vcl, VCL_CONF_MAGIC);
- sp->wrk->acct.pipe++;
+ sp->acct_req.pipe++;
http_FilterHeader(sp, HTTPH_R_PIPE);
VCL_pipe_method(sp);
VSL_stats->client_req++; /* XXX not locked */
sp->t_req = TIM_real();
sp->wrk->lastused = sp->t_req;
- sp->wrk->acct.req++;
+ sp->acct_req.req++;
/* Assign XID and log */
sp->xid = ++xids; /* XXX not locked */
TCP_blocking(vc->fd);
WRW_Reserve(w, &vc->fd);
- w->acct.hdrbytes += http_Write(w, bereq->http, 0);
+ sp->acct_req.hdrbytes += http_Write(w, bereq->http, 0);
if (sp->htc->pipeline.b != NULL)
- w->acct.bodybytes +=
+ sp->acct_req.bodybytes +=
WRW_Write(w, sp->htc->pipeline.b, Tlen(sp->htc->pipeline));
if (WRW_FlushRelease(w)) {
WRW_Reserve(sp->wrk, &sp->fd);
if (sp->esis == 0)
- sp->wrk->acct.hdrbytes += http_Write(sp->wrk, sp->http, 1);
+ sp->acct_req.hdrbytes += http_Write(sp->wrk, sp->http, 1);
if (sp->wantbody && !VTAILQ_EMPTY(&sp->obj->esibits)) {
if (WRW_FlushRelease(sp->wrk)) {
CHECK_OBJ_NOTNULL(sp, SESS_MAGIC);
CHECK_OBJ_NOTNULL(st, STORAGE_MAGIC);
u += st->len;
- sp->wrk->acct.bodybytes += st->len;
+ sp->acct_req.bodybytes += st->len;
#ifdef SENDFILE_WORKS
/*
* XXX: the overhead of setting up sendfile is not
void
SES_Charge(struct sess *sp)
{
- struct acct *a = &sp->wrk->acct;
+ struct acct *a = &sp->acct_req;
struct acct b;
ses_sum_acct(&sp->acct, a);
if (Tlen(eb->verbatim)) {
if (sp->http->protover >= 1.1)
(void)WRW_Write(sp->wrk, eb->chunk_length, -1);
- sp->wrk->acct.bodybytes += WRW_Write(sp->wrk,
+ sp->acct_req.bodybytes += WRW_Write(sp->wrk,
eb->verbatim.b, Tlen(eb->verbatim));
if (sp->http->protover >= 1.1)
(void)WRW_Write(sp->wrk, "\r\n", -1);