diff options
author | Ronnie Sahlberg <ronniesahlberg@gmail.com> | 2012-03-07 17:02:41 +1100 |
---|---|---|
committer | Ronnie Sahlberg <ronniesahlberg@gmail.com> | 2012-03-20 11:20:53 +1100 |
commit | 038c946e80b9f710e5949876bbd763033ab8e5ce (patch) | |
tree | 00db388a14e11bab6d949457188e5dc760d2ad9e /ctdb/server/ctdb_call.c | |
parent | b3ddf6901d1f4706731771606f466da4c6165fd9 (diff) | |
download | samba-038c946e80b9f710e5949876bbd763033ab8e5ce.tar.gz samba-038c946e80b9f710e5949876bbd763033ab8e5ce.tar.xz samba-038c946e80b9f710e5949876bbd763033ab8e5ce.zip |
add max hop count buckets to see how bad hopcounts are
(This used to be ctdb commit 7d3931298e6477d92f43652c3006b0c426cb1307)
Diffstat (limited to 'ctdb/server/ctdb_call.c')
-rw-r--r-- | ctdb/server/ctdb_call.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/ctdb/server/ctdb_call.c b/ctdb/server/ctdb_call.c index 50f4cb2e1f..7e61710340 100644 --- a/ctdb/server/ctdb_call.c +++ b/ctdb/server/ctdb_call.c @@ -465,6 +465,7 @@ void ctdb_request_call(struct ctdb_context *ctdb, struct ctdb_req_header *hdr) struct ctdb_ltdb_header header; struct ctdb_call *call; struct ctdb_db_context *ctdb_db; + int tmp_count, bucket; if (ctdb->methods == NULL) { DEBUG(DEBUG_INFO,(__location__ " Failed ctdb_request_call. Transport is DOWN\n")); @@ -629,6 +630,17 @@ void ctdb_request_call(struct ctdb_context *ctdb, struct ctdb_req_header *hdr) } CTDB_UPDATE_STAT(ctdb, max_hop_count, c->hopcount); + tmp_count = c->hopcount; + bucket = 0; + while (tmp_count) { + tmp_count >>= 2; + bucket++; + } + if (bucket >= MAX_HOP_COUNT_BUCKETS) { + bucket = MAX_HOP_COUNT_BUCKETS - 1; + } + CTDB_INCREMENT_STAT(ctdb, hop_count_bucket[bucket]); + /* Try if possible to migrate the record off to the caller node. * From the clients perspective a fetch of the data is just as |