Commit bc1d749a authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

Shave acct_req down to a bodybytes counter, it's all we use it for.

Make pipe mode use the acct_tmp like everybody else.
parent 8faf5870
......@@ -218,9 +218,9 @@ struct acct {
/*--------------------------------------------------------------------*/
#define L0(n)
#define L1(n) uint64_t n;
#define VSC_F(n, t, l, f, e,d) L##l(n)
#define L0(t, n)
#define L1(t, n) t n;
#define VSC_F(n, t, l, f, e,d) L##l(t, n)
#define VSC_DO_MAIN
struct dstat {
#include "vsc_fields.h"
......@@ -615,7 +615,7 @@ struct sess {
struct sessmem *mem;
VTAILQ_ENTRY(sess) poollist;
struct acct acct_req;
uint64_t req_bodybytes;
struct acct acct_ses;
#if defined(HAVE_EPOLL_CTL)
......
......@@ -338,7 +338,8 @@ cnt_done(struct sess *sp)
/* XXX: Add StatReq == StatSess */
/* XXX: Workaround for pipe */
if (sp->fd >= 0) {
WSP(sp, SLT_Length, "%ju", (uintmax_t)sp->acct_req.bodybytes);
WSP(sp, SLT_Length, "%ju",
(uintmax_t)sp->req_bodybytes);
}
WSL(sp->wrk, SLT_ReqEnd, sp->id, "%u %.9f %.9f %.9f %.9f %.9f",
sp->xid, sp->t_req, sp->t_end, dh, dp, da);
......@@ -352,7 +353,7 @@ cnt_done(struct sess *sp)
if (sp->esi_level > 0)
return (1);
memset(&sp->acct_req, 0, sizeof sp->acct_req);
sp->req_bodybytes = 0;
sp->t_req = NAN;
sp->hash_always_miss = 0;
......
......@@ -78,10 +78,10 @@ PipeSession(struct sess *sp)
(void)VTCP_blocking(vc->fd);
WRW_Reserve(w, &vc->fd);
sp->acct_req.hdrbytes += http_Write(w, sp->wrk->bereq, 0);
sp->wrk->acct_tmp.hdrbytes += http_Write(w, sp->wrk->bereq, 0);
if (sp->htc->pipeline.b != NULL)
sp->acct_req.bodybytes +=
sp->wrk->acct_tmp.bodybytes +=
WRW_Write(w, sp->htc->pipeline.b, Tlen(sp->htc->pipeline));
i = WRW_FlushRelease(w);
......
......@@ -80,9 +80,10 @@ SES_Charge(struct sess *sp)
{
struct acct *a = &sp->wrk->acct_tmp;
sp->req_bodybytes += a->bodybytes;
#define ACCT(foo) \
sp->wrk->stats.s_##foo += a->foo; \
sp->acct_req.foo += a->foo; \
sp->acct_ses.foo += a->foo; \
a->foo = 0;
#include "acct_fields.h"
......
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