/*
ctdb statistics information
*/
+#define MAX_COUNT_BUCKETS 16
+
struct ctdb_statistics {
uint32_t num_clients;
uint32_t frozen;
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;
struct ctdb_db_statistics {
uint32_t db_ro_delegations;
uint32_t db_ro_revokes;
+ uint32_t hop_count_bucket[MAX_COUNT_BUCKETS];
};
/*
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.
*(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");
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;