Add the number of performed recoveries to the "ctdb statistics" output.
authorRonnie Sahlberg <ronniesahlberg@gmail.com>
Mon, 10 May 2010 23:28:59 +0000 (09:28 +1000)
committerRonnie Sahlberg <ronniesahlberg@gmail.com>
Mon, 10 May 2010 23:44:53 +0000 (09:44 +1000)
include/ctdb_private.h
server/ctdb_recover.c
tools/ctdb.c

index 5dbd3f8ef2fe892f26db02bb8ae3d31106eb0b4a..c0621204dda41d2bc9eba6b58722bf18d07f2795 100644 (file)
@@ -346,6 +346,7 @@ struct ctdb_statistics {
        double max_call_latency;
        double max_lockwait_latency;
        double max_childwrite_latency;
+       uint32_t num_recoveries;
 };
 
 
index 4a1e04c2f1f8e0400bb323a29f95fef1f6cfa3cb..22e48986f41d4a1828b397dd1fce13edb582dfe8 100644 (file)
@@ -938,6 +938,7 @@ static void ctdb_end_recovery_callback(struct ctdb_context *ctdb, int status, vo
        struct recovery_callback_state *state = talloc_get_type(p, struct recovery_callback_state);
 
        ctdb_enable_monitoring(ctdb);
+       ctdb->statistics.num_recoveries++;
 
        if (status != 0) {
                DEBUG(DEBUG_ERR,(__location__ " recovered event script failed (status %d)\n", status));
index 5137846235495d6ddb3f0947dbac36e4ea16af7f..e698c407b45e970fbfeab4cb32910ad749eade8f 100644 (file)
@@ -167,6 +167,7 @@ static void show_statistics(struct ctdb_statistics *s)
                STATISTICS_FIELD(num_clients),
                STATISTICS_FIELD(frozen),
                STATISTICS_FIELD(recovering),
+               STATISTICS_FIELD(num_recoveries),
                STATISTICS_FIELD(client_packets_sent),
                STATISTICS_FIELD(client_packets_recv),
                STATISTICS_FIELD(node_packets_sent),