1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-26 10:04:02 +03:00

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>
This commit is contained in:
Amitay Isaacs 2013-11-15 18:36:09 +11:00 committed by Michael Adam
parent 3879e9991f
commit 0eeb73c187

View File

@ -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);
}
}