diff options
Diffstat (limited to 'ctdb')
| -rw-r--r-- | ctdb/include/ctdb_protocol.h | 6 | ||||
| -rw-r--r-- | ctdb/server/ctdb_call.c | 5 | ||||
| -rw-r--r-- | ctdb/tools/ctdb.c | 7 |
3 files changed, 13 insertions, 5 deletions
diff --git a/ctdb/include/ctdb_protocol.h b/ctdb/include/ctdb_protocol.h index 6c1cc64752..ec52f5626c 100644 --- a/ctdb/include/ctdb_protocol.h +++ b/ctdb/include/ctdb_protocol.h @@ -603,6 +603,8 @@ struct ctdb_traverse_start_ext { /* ctdb statistics information */ +#define MAX_COUNT_BUCKETS 16 + struct ctdb_statistics { uint32_t num_clients; uint32_t frozen; @@ -646,8 +648,7 @@ struct ctdb_statistics { uint32_t memory_used; uint32_t __last_counter; /* hack for control_statistics_all */ uint32_t max_hop_count; -#define MAX_HOP_COUNT_BUCKETS 16 - uint32_t hop_count_bucket[MAX_HOP_COUNT_BUCKETS]; + uint32_t hop_count_bucket[MAX_COUNT_BUCKETS]; struct latency_counter call_latency; struct latency_counter lockwait_latency; struct latency_counter childwrite_latency; @@ -672,6 +673,7 @@ struct ctdb_statistics_wire { struct ctdb_db_statistics { uint32_t db_ro_delegations; uint32_t db_ro_revokes; + uint32_t hop_count_bucket[MAX_COUNT_BUCKETS]; }; /* diff --git a/ctdb/server/ctdb_call.c b/ctdb/server/ctdb_call.c index 7e61710340..c015fbfff6 100644 --- a/ctdb/server/ctdb_call.c +++ b/ctdb/server/ctdb_call.c @@ -636,10 +636,11 @@ void ctdb_request_call(struct ctdb_context *ctdb, struct ctdb_req_header *hdr) tmp_count >>= 2; bucket++; } - if (bucket >= MAX_HOP_COUNT_BUCKETS) { - bucket = MAX_HOP_COUNT_BUCKETS - 1; + if (bucket >= MAX_COUNT_BUCKETS) { + bucket = MAX_COUNT_BUCKETS - 1; } CTDB_INCREMENT_STAT(ctdb, hop_count_bucket[bucket]); + CTDB_INCREMENT_DB_STAT(ctdb_db, hop_count_bucket[bucket]); /* Try if possible to migrate the record off to the caller node. diff --git a/ctdb/tools/ctdb.c b/ctdb/tools/ctdb.c index 28b6e8fc3a..893d91fb23 100644 --- a/ctdb/tools/ctdb.c +++ b/ctdb/tools/ctdb.c @@ -443,7 +443,7 @@ static void show_statistics(struct ctdb_statistics *s, int show_header) *(uint32_t *)(fields[i].offset+(uint8_t *)s)); } printf(" hop_count_buckets:"); - for (i=0;i<MAX_HOP_COUNT_BUCKETS;i++) { + for (i=0;i<MAX_COUNT_BUCKETS;i++) { printf(" %d", s->hop_count_bucket[i]); } printf("\n"); @@ -615,6 +615,11 @@ static int control_dbstatistics(struct ctdb_context *ctdb, int argc, const char printf("DB Statistics:\n"); printf("RO Delegations: %d\n", dbstatistics->db_ro_delegations); printf("RO Revokes: %d\n", dbstatistics->db_ro_revokes); + printf(" hop_count_buckets:"); + for (i=0;i<MAX_COUNT_BUCKETS;i++) { + printf(" %d", dbstatistics->hop_count_bucket[i]); + } + printf("\n"); ctdb_free_dbstat(dbstatistics); return 0; |
