summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAmitay Isaacs <amitay@gmail.com>2013-11-15 18:36:09 +1100
committerMichael Adam <obnox@samba.org>2013-11-27 18:46:16 +0100
commit0eeb73c1879dbb45db32e68f1e4cdbbfd3f9c14f (patch)
tree212aacdf67c260adc34324b05d00f2d490dc7e73
parent3879e9991f51638290006cf9382c6c487b2f191a (diff)
downloadsamba-0eeb73c1879dbb45db32e68f1e4cdbbfd3f9c14f.tar.gz
samba-0eeb73c1879dbb45db32e68f1e4cdbbfd3f9c14f.tar.xz
samba-0eeb73c1879dbb45db32e68f1e4cdbbfd3f9c14f.zip
ctdb-locking: Update current lock statistics when lock is scheduled
When a child process is created for a lock request, the current locks statistics should be updated immediately. This will provide accurate information on number of active lock requests. Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Michael Adam <obnox@samba.org>
-rw-r--r--ctdb/server/ctdb_lock.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/ctdb/server/ctdb_lock.c b/ctdb/server/ctdb_lock.c
index 1c33396606..4f9e19bd28 100644
--- a/ctdb/server/ctdb_lock.c
+++ b/ctdb/server/ctdb_lock.c
@@ -466,13 +466,11 @@ static void ctdb_lock_handler(struct tevent_context *ev,
if (locked) {
if (lock_ctx->ctdb_db) {
- CTDB_INCREMENT_STAT(lock_ctx->ctdb, locks.num_current);
CTDB_INCREMENT_STAT(lock_ctx->ctdb, locks.buckets[id]);
CTDB_UPDATE_LATENCY(lock_ctx->ctdb, lock_ctx->ctdb_db,
lock_type_str[lock_ctx->type], locks.latency,
lock_ctx->start_time);
- CTDB_INCREMENT_DB_STAT(lock_ctx->ctdb_db, locks.num_current);
CTDB_UPDATE_DB_LATENCY(lock_ctx->ctdb_db, lock_type_str[lock_ctx->type], locks.latency, t);
CTDB_INCREMENT_DB_STAT(lock_ctx->ctdb_db, locks.buckets[id]);
}
@@ -877,6 +875,8 @@ static void ctdb_lock_schedule(struct ctdb_context *ctdb)
DLIST_ADD_END(ctdb->lock_current, lock_ctx, NULL);
if (lock_ctx->ctdb_db) {
lock_ctx->ctdb_db->lock_num_current++;
+ CTDB_INCREMENT_STAT(lock_ctx->ctdb, locks.num_current);
+ CTDB_INCREMENT_DB_STAT(lock_ctx->ctdb_db, locks.num_current);
}
}