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:28:59 +0000 (09:28 +1000)
include/ctdb_private.h
server/ctdb_recover.c
tools/ctdb.c

index cf3cdcd2ac4907ff0ab18bebb985ac3f839d7d4a..6893d67b29329d37ebc2aa20a12157e2f41162e9 100644 (file)
@@ -344,6 +344,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 f91c77de80f181ef2c76455b8379c174a1d4f35d..7ae3974769a63d69424a453b8e1f00edf3cdc411 100644 (file)
@@ -166,6 +166,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),