lib, vtysh: rebase hashstats

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
This commit is contained in:
Quentin Young 2017-06-30 16:56:10 +00:00
parent b3db0a22b7
commit e703a0f3af
No known key found for this signature in database
GPG Key ID: DAF48E0F57E0834F
2 changed files with 13 additions and 16 deletions

View File

@ -458,22 +458,21 @@ DEFUN(show_hash_stats,
char underln[sizeof(header) + strlen(frr_protonameinst)]; char underln[sizeof(header) + strlen(frr_protonameinst)];
memset (underln, '-', sizeof(underln)); memset (underln, '-', sizeof(underln));
underln[sizeof(underln) - 1] = '\0'; underln[sizeof(underln) - 1] = '\0';
vty_out (vty, "%s%s%s", header, frr_protonameinst, VTY_NEWLINE); vty_outln (vty, "%s%s", header, frr_protonameinst);
vty_out (vty, "%s%s", underln, VTY_NEWLINE); vty_outln (vty, "%s", underln);
vty_out (vty, "# allocated: %d%s", _hashes->count, VTY_NEWLINE); vty_outln (vty, "# allocated: %d", _hashes->count);
vty_out (vty, "# named: %d%s%s", tt->nrows - 1, VTY_NEWLINE, vty_outln (vty, "# named: %d%s", tt->nrows - 1, VTYNL);
VTY_NEWLINE);
if (tt->nrows > 1) if (tt->nrows > 1)
{ {
ttable_colseps (tt, 0, RIGHT, true, '|'); ttable_colseps (tt, 0, RIGHT, true, '|');
char *table = ttable_dump (tt, VTY_NEWLINE); char *table = ttable_dump (tt, VTYNL);
vty_out (vty, "%s%s", table, VTY_NEWLINE); vty_out (vty, "%s%s", table, VTYNL);
XFREE (MTYPE_TMP, table); XFREE (MTYPE_TMP, table);
} }
else else
vty_out (vty, "No named hash tables to display.%s", VTY_NEWLINE); vty_outln (vty, "No named hash tables to display.");
ttable_del (tt); ttable_del (tt);

View File

@ -2114,15 +2114,13 @@ DEFUN (vtysh_show_hashtable,
unsigned long i; unsigned long i;
int ret = CMD_SUCCESS; int ret = CMD_SUCCESS;
vty_out (vty, "%sLoad factor (LF) - average number of elements across all " fprintf (stdout, "\n");
"buckets%s", VTY_NEWLINE, VTY_NEWLINE); fprintf (stdout, "Load factor (LF) - average number of elements across all buckets\n");
vty_out (vty, "Full load factor (FLF) - average number of elements " fprintf (stdout, "Full load factor (FLF) - average number of elements across full buckets\n\n");
"across full buckets%s%s", VTY_NEWLINE, VTY_NEWLINE);
vty_out (vty, "Standard deviation (SD) is calculated for both the LF and FLF%s", VTY_NEWLINE); fprintf (stdout, "Standard deviation (SD) is calculated for both the LF and FLF\n");
vty_out (vty, "and indicates the typical deviation of bucket chain length%s", VTY_NEWLINE); fprintf (stdout, "and indicates the typical deviation of bucket chain length\n");
vty_out (vty, "from the value in the corresponding load factor.%s%s", fprintf (stdout, "from the value in the corresponding load factor.\n\n");
VTY_NEWLINE, VTY_NEWLINE);
for (i = 0; i < array_size(vtysh_client); i++) for (i = 0; i < array_size(vtysh_client); i++)
if ( vtysh_client[i].fd >= 0 ) { if ( vtysh_client[i].fd >= 0 ) {