X-Git-Url: https://jfr.im/git/solanum.git/blobdiff_plain/d38c08c17873ff85da1049b5719e0585ee5cdf95..a393a68a0e1db47faafb71308f9bc93c3704bcb0:/ircd/hash.c diff --git a/ircd/hash.c b/ircd/hash.c index 88694911..7658536d 100644 --- a/ircd/hash.c +++ b/ircd/hash.c @@ -534,66 +534,3 @@ find_cli_connid_hash(uint32_t connid) return NULL; } - -static void -output_hash(struct Client *source_p, const char *name, int length, int *counts, unsigned long deepest) -{ - unsigned long total = 0; - int i; - char buf[128]; - - sendto_one_numeric(source_p, RPL_STATSDEBUG, - "B :%s Hash Statistics", name); - - snprintf(buf, sizeof buf, "%.3f%%", - (float) ((counts[0]*100) / (float) length)); - sendto_one_numeric(source_p, RPL_STATSDEBUG, - "B :Size: %d Empty: %d (%s)", - length, counts[0], buf); - - for(i = 1; i < 11; i++) - { - total += (counts[i] * i); - } - - /* dont want to divide by 0! --fl */ - if(counts[0] != length) - { - snprintf(buf, sizeof buf, "%.3f/%.3f", - (float) (total / (length - counts[0])), - (float) (total / length)); - sendto_one_numeric(source_p, RPL_STATSDEBUG, - "B :Average depth: %s Highest depth: %lu", - buf, deepest); - } -} - - -static void -count_hash(struct Client *source_p, rb_dlink_list *table, int length, const char *name) -{ - int counts[11]; - unsigned long deepest = 0; - int i; - - memset(counts, 0, sizeof(counts)); - - for(i = 0; i < length; i++) - { - if(rb_dlink_list_length(&table[i]) >= 10) - counts[10]++; - else - counts[rb_dlink_list_length(&table[i])]++; - - if(rb_dlink_list_length(&table[i]) > deepest) - deepest = rb_dlink_list_length(&table[i]); - } - - output_hash(source_p, name, length, counts, deepest); -} - -void -hash_stats(struct Client *source_p) -{ - count_hash(source_p, hostTable, HOST_MAX, "Hostname"); -}