ircd: make STATS B easier to understand

This commit is contained in:
William Pitcock 2016-01-09 06:23:13 -06:00
parent a21e57bebe
commit 8dacf9e917
4 changed files with 6 additions and 15 deletions

View file

@ -597,13 +597,6 @@ output_hash(struct Client *source_p, const char *name, int length, int *counts,
"B :Average depth: %s Highest depth: %lu",
buf, deepest);
}
for(i = 0; i < 11; i++)
{
sendto_one_numeric(source_p, RPL_STATSDEBUG,
"B :Nodes with %d entries: %d",
i, counts[i]);
}
}

View file

@ -823,11 +823,11 @@ void irc_dictionary_stats(struct Dictionary *dict, void (*cb)(const char *line,
{
maxdepth = 0;
sum = stats_recurse(dict->root, 0, &maxdepth);
rb_snprintf(str, sizeof str, "%s: Objects: %d, Depth sum: %d, Avg depth: %d, Max depth: %d.", dict->id, dict->count, sum, sum / dict->count, maxdepth);
snprintf(str, sizeof str, "%-30s %-15s %-10d %-10d %-10d %-10d", dict->id, "DICT", dict->count, sum, sum / dict->count, maxdepth);
}
else
{
rb_snprintf(str, sizeof str, "%s: Objects: 0, Depth sum: 0, Avg depth: 0, Max depth: 0.", dict->id);
snprintf(str, sizeof str, "%-30s %-15s %-10s %-10s %-10s %-10s", dict->id, "DICT", "0", "0", "0", "0");
}
cb(str, privdata);

View file

@ -1036,11 +1036,11 @@ irc_radixtree_stats(struct irc_radixtree *dict, void (*cb)(const char *line, voi
if (dict->count > 0)
{
sum = stats_recurse(dict->root, 0, &maxdepth);
snprintf(str, sizeof str, "%s: Objects: %d, Depth sum: %d, Avg depth: %d, Max depth: %d.", dict->id, dict->count, sum, sum / dict->count, maxdepth);
snprintf(str, sizeof str, "%-30s %-15s %-10d %-10d %-10d %-10d", dict->id, "RADIX", dict->count, sum, sum / dict->count, maxdepth);
}
else
{
snprintf(str, sizeof str, "%s: Objects: 0, Depth sum: 0, Avg depth: 0, Max depth: 0.", dict->id);
snprintf(str, sizeof str, "%-30s %-15s %-10s %-10s %-10s %-10s", dict->id, "RADIX", "0", "0", "0", "0");
}
cb(str, privdata);

View file

@ -281,12 +281,10 @@ stats_hash_cb(const char *buf, void *client_p)
static void
stats_hash(struct Client *source_p)
{
hash_stats(source_p);
sendto_one_numeric(source_p, RPL_STATSDEBUG, "B :%-30s %-15s %-10s %-10s %-10s %-10s",
"NAME", "TYPE", "OBJECTS", "DEPTH SUM", "AVG DEPTH", "MAX DEPTH");
sendto_one_numeric(source_p, RPL_STATSDEBUG, "B :Dictionary stats:");
irc_dictionary_stats_walk(stats_hash_cb, source_p);
sendto_one_numeric(source_p, RPL_STATSDEBUG, "B :Radix tree stats:");
irc_radixtree_stats_walk(stats_hash_cb, source_p);
}