[master] b3f15ef New counters for VBE.
Arianna Aondio
arianna.aondio at varnish-software.com
Mon Nov 10 16:39:04 CET 2014
commit b3f15efc5b161e2ee0bd47b860fad2b300e1fc29
Author: Arianna Aondio <arianna.aondio at varnish-software.com>
Date: Wed Nov 5 10:54:03 2014 +0100
New counters for VBE.
diff --git a/bin/varnishd/cache/cache_backend.c b/bin/varnishd/cache/cache_backend.c
index 8454f56..4dda66b 100644
--- a/bin/varnishd/cache/cache_backend.c
+++ b/bin/varnishd/cache/cache_backend.c
@@ -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);
diff --git a/bin/varnishd/cache/cache_backend_cfg.c b/bin/varnishd/cache/cache_backend_cfg.c
index 5cf077e..bc80ae5 100644
--- a/bin/varnishd/cache/cache_backend_cfg.c
+++ b/bin/varnishd/cache/cache_backend_cfg.c
@@ -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);
}
diff --git a/include/tbl/vsc_fields.h b/include/tbl/vsc_fields.h
index 64e63a3..0d646a2 100644
--- a/include/tbl/vsc_fields.h
+++ b/include/tbl/vsc_fields.h
@@ -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
More information about the varnish-commit
mailing list