Commit 93a2f064 authored by Arianna Aondio's avatar Arianna Aondio

Merge branch 'VBE'

Added two counters to VBE.
conn: concurrent connections to backend.
req: number requests sent to backend.
parents 980243cb b3f15efc
......@@ -151,6 +151,7 @@ bes_conn_try(struct busyobj *bo, struct vbc *vc, const struct vbe_dir *vs)
Lck_Lock(&bp->mtx);
bp->refcount++;
bp->n_conn++; /* It mostly works */
bp->vsc->conn++;
Lck_Unlock(&bp->mtx);
s = -1;
......@@ -175,6 +176,7 @@ bes_conn_try(struct busyobj *bo, struct vbc *vc, const struct vbe_dir *vs)
if (s < 0) {
Lck_Lock(&bp->mtx);
bp->n_conn--;
bp->vsc->conn--;
bp->refcount--; /* Only keep ref on success */
Lck_Unlock(&bp->mtx);
vc->addr = NULL;
......@@ -359,6 +361,7 @@ vbe_dir_getfd(const struct director *d, struct busyobj *bo)
return (-1);
}
vc->backend->vsc->req++;
if (bo->htc == NULL)
bo->htc = WS_Alloc(bo->ws, sizeof *bo->htc);
AN(bo->htc);
......
......@@ -150,6 +150,7 @@ VBE_DropRefConn(struct backend *b, const struct acct_bereq *acct_bereq)
Lck_Lock(&b->mtx);
assert(b->n_conn > 0);
b->n_conn--;
b->vsc->conn--;
VBE_DropRefLocked(b, acct_bereq);
}
......
......@@ -214,6 +214,14 @@ VSC_F(pipe_in, uint64_t, 0, 'a', info,
"Total number of bytes forwarded from backend in"
" pipe sessions"
)
VSC_F(conn, uint64_t, 0, 'g', info,
"Concurrent connections to backend",
""
)
VSC_F(req, uint64_t, 0, 'c', info,
"Backend requests sent",
""
)
#endif
......
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