ctdb-daemon: Divide by 2 when calculating hop count bucket
authorMartin Schwenke <martin@meltin.net>
Thu, 15 Nov 2018 02:58:53 +0000 (13:58 +1100)
committerAmitay Isaacs <amitay@samba.org>
Tue, 18 Dec 2018 01:02:03 +0000 (02:02 +0100)
This provides finer resolution while still maintaining a reasonable
maximum.  In this case the top bucket contains any hop counts
>= 16384, compared to the current situation where the top bucket contains
hop counts >= 268435456.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
ctdb/doc/ctdb-statistics.7.xml
ctdb/server/ctdb_call.c

index 8d6349d16e6cd74b27a8c08d0c8d3d6da0797f5e..cb8e5d946895a402d8f25186fa4071cf2499984a 100644 (file)
@@ -436,8 +436,10 @@ Statistics collected since  : (000 01:49:20) Fri Sep 12 11:43:12 2014
       <title>hop_count_buckets</title>
       <para>
        Distribution of migration requests based on hop counts values.
-       Buckets are 1, &lt; 4, &lt; 8, &lt; 16, &lt; 32, &lt; 64, &lt;
-       128, &lt; 256, &lt; 512, &ge; 512.
+       Buckets are 0, &lt;&nbsp;2, &lt;&nbsp;4, &lt;&nbsp;8,
+       &lt;&nbsp;16, &lt;&nbsp;32, &lt;&nbsp;64, &lt;&nbsp;128,
+       &lt;&nbsp;256, &lt;&nbsp;512, &lt;&nbsp;1024, &lt;&nbsp;2048,
+       &lt;&nbsp;4096, &lt;&nbsp;8192, &lt;&nbsp;16384, &ge;&nbsp;16384.
       </para>
     </refsect2>
 
@@ -595,8 +597,10 @@ DB Statistics: notify_index.tdb
       <title>hop_count_buckets</title>
       <para>
        Distribution of migration requests based on hop counts values.
-       Buckets are 1, &lt; 4, &lt; 8, &lt; 16, &lt; 32, &lt; 64, &lt;
-       128, &lt; 256, &lt; 512, &ge; 512.
+       Buckets are 0, &lt;&nbsp;2, &lt;&nbsp;4, &lt;&nbsp;8,
+       &lt;&nbsp;16, &lt;&nbsp;32, &lt;&nbsp;64, &lt;&nbsp;128,
+       &lt;&nbsp;256, &lt;&nbsp;512, &lt;&nbsp;1024, &lt;&nbsp;2048,
+       &lt;&nbsp;4096, &lt;&nbsp;8192, &lt;&nbsp;16384, &ge;&nbsp;16384.
       </para>
     </refsect2>
 
index 030592060263964835f9930a59e1435977927ea6..346fe89010e59d36572106616ffa6cf351746787 100644 (file)
@@ -1092,7 +1092,7 @@ void ctdb_request_call(struct ctdb_context *ctdb, struct ctdb_req_header *hdr)
        tmp_count = c->hopcount;
        bucket = 0;
        while (tmp_count) {
-               tmp_count >>= 2;
+               tmp_count >>= 1;
                bucket++;
        }
        if (bucket >= MAX_COUNT_BUCKETS) {