ctdb-protocol: Add req_tunnel counts to ctdb statistics
authorAmitay Isaacs <amitay@gmail.com>
Thu, 6 Apr 2017 07:50:38 +0000 (17:50 +1000)
committerMartin Schwenke <martins@samba.org>
Tue, 10 Oct 2017 09:45:19 +0000 (11:45 +0200)
Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
ctdb/doc/ctdb-statistics.7.xml
ctdb/protocol/protocol.h
ctdb/protocol/protocol_types.c
ctdb/tools/ctdb.c

index 77301ab7893e4bd282f374d38495c6459f24252a..8d6349d16e6cd74b27a8c08d0c8d3d6da0797f5e 100644 (file)
@@ -253,6 +253,13 @@ Statistics collected since  : (000 01:49:20) Fri Sep 12 11:43:12 2014
       </para>
     </refsect3>
 
+    <refsect3>
+      <title>req_tunnel</title>
+      <para>
+        Number of REQ_TUNNEL messages from the other nodes.
+      </para>
+    </refsect3>
+
     </refsect2>
 
     <refsect2>
@@ -283,6 +290,13 @@ Statistics collected since  : (000 01:49:20) Fri Sep 12 11:43:12 2014
       </para>
     </refsect3>
 
+    <refsect3>
+      <title>req_tunnel</title>
+      <para>
+        Number of REQ_TUNNEL messages from the clients.
+      </para>
+    </refsect3>
+
     </refsect2>
 
     <refsect2>
index 94be5913781e186d92a125c64caea17c6db94d27..af263519c9657178476ffc2ee43a4b6d752a0139 100644 (file)
@@ -404,11 +404,13 @@ struct ctdb_statistics {
                uint32_t req_message;
                uint32_t req_control;
                uint32_t reply_control;
+               uint32_t req_tunnel;
        } node;
        struct {
                uint32_t req_call;
                uint32_t req_message;
                uint32_t req_control;
+               uint32_t req_tunnel;
        } client;
        struct {
                uint32_t call;
index 83d5d78fa6ec32f2ae368e6eeb9e95487ae195c4..416d4843b7463a78f55ddcce65587f55bffdf8cd 100644 (file)
@@ -206,9 +206,11 @@ size_t ctdb_statistics_len(struct ctdb_statistics *in)
                ctdb_uint32_len(&in->node.req_message) +
                ctdb_uint32_len(&in->node.req_control) +
                ctdb_uint32_len(&in->node.reply_control) +
+               ctdb_uint32_len(&in->node.req_tunnel) +
                ctdb_uint32_len(&in->client.req_call) +
                ctdb_uint32_len(&in->client.req_message) +
                ctdb_uint32_len(&in->client.req_control) +
+               ctdb_uint32_len(&in->client.req_tunnel) +
                ctdb_uint32_len(&in->timeouts.call) +
                ctdb_uint32_len(&in->timeouts.control) +
                ctdb_uint32_len(&in->timeouts.traverse) +
@@ -298,6 +300,9 @@ void ctdb_statistics_push(struct ctdb_statistics *in, uint8_t *buf,
        ctdb_uint32_push(&in->node.reply_control, buf+offset, &np);
        offset += np;
 
+       ctdb_uint32_push(&in->node.req_tunnel, buf+offset, &np);
+       offset += np;
+
        ctdb_uint32_push(&in->client.req_call, buf+offset, &np);
        offset += np;
 
@@ -307,6 +312,9 @@ void ctdb_statistics_push(struct ctdb_statistics *in, uint8_t *buf,
        ctdb_uint32_push(&in->client.req_control, buf+offset, &np);
        offset += np;
 
+       ctdb_uint32_push(&in->client.req_tunnel, buf+offset, &np);
+       offset += np;
+
        ctdb_uint32_push(&in->timeouts.call, buf+offset, &np);
        offset += np;
 
@@ -527,6 +535,13 @@ static int ctdb_statistics_pull_elems(uint8_t *buf, size_t buflen,
        }
        offset += np;
 
+       ret = ctdb_uint32_pull(buf+offset, buflen-offset,
+                              &out->node.req_tunnel, &np);
+       if (ret != 0) {
+               return ret;
+       }
+       offset += np;
+
        ret = ctdb_uint32_pull(buf+offset, buflen-offset,
                               &out->client.req_call, &np);
        if (ret != 0) {
@@ -548,6 +563,13 @@ static int ctdb_statistics_pull_elems(uint8_t *buf, size_t buflen,
        }
        offset += np;
 
+       ret = ctdb_uint32_pull(buf+offset, buflen-offset,
+                              &out->client.req_tunnel, &np);
+       if (ret != 0) {
+               return ret;
+       }
+       offset += np;
+
        ret = ctdb_uint32_pull(buf+offset, buflen-offset,
                               &out->timeouts.call, &np);
        if (ret != 0) {
index a5cfaf42f9eeb47d6a061c2072203aa7d7ad22af..8d7adb58ad4e8c0a805213898ccf2206d7b31740 100644 (file)
@@ -1160,9 +1160,11 @@ const struct {
        STATISTICS_FIELD(node.req_message),
        STATISTICS_FIELD(node.req_control),
        STATISTICS_FIELD(node.reply_control),
+       STATISTICS_FIELD(node.req_tunnel),
        STATISTICS_FIELD(client.req_call),
        STATISTICS_FIELD(client.req_message),
        STATISTICS_FIELD(client.req_control),
+       STATISTICS_FIELD(client.req_tunnel),
        STATISTICS_FIELD(timeouts.call),
        STATISTICS_FIELD(timeouts.control),
        STATISTICS_FIELD(timeouts.traverse),