diff options
author | Daniel Walton <dwalton@cumulusnetworks.com> | 2017-07-05 21:41:51 +0200 |
---|---|---|
committer | Daniel Walton <dwalton@cumulusnetworks.com> | 2017-07-05 21:41:51 +0200 |
commit | b83c95ce27d1bb7af54767e3265a04b3ad7d058b (patch) | |
tree | 4844d16fa6af7742c311c34bf24110f4ab25c7c1 /vtysh/vtysh.c | |
parent | bgpd: Install SAFI_LABELED_UNICAST routes in SAFI_UNICAST table (diff) | |
parent | Merge pull request #742 from qlyoung/hashstats (diff) | |
download | frr-b83c95ce27d1bb7af54767e3265a04b3ad7d058b.tar.xz frr-b83c95ce27d1bb7af54767e3265a04b3ad7d058b.zip |
Merge branch 'master' of https://github.com/dwalton76/frr into bgpd-ipv4-plus-label-misc3
Diffstat (limited to 'vtysh/vtysh.c')
-rw-r--r-- | vtysh/vtysh.c | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/vtysh/vtysh.c b/vtysh/vtysh.c index ec1a0030a..f5f532d53 100644 --- a/vtysh/vtysh.c +++ b/vtysh/vtysh.c @@ -2104,6 +2104,33 @@ DEFUN (vtysh_show_work_queues_daemon, return ret; } +DEFUN (vtysh_show_hashtable, + vtysh_show_hashtable_cmd, + "show hashtable [statistics]", + SHOW_STR + "Statistics about hash tables\n" + "Statistics about hash tables\n") +{ + char cmd[] = "do show hashtable statistics"; + unsigned long i; + int ret = CMD_SUCCESS; + + fprintf (stdout, "\n"); + fprintf (stdout, "Load factor (LF) - average number of elements across all buckets\n"); + fprintf (stdout, "Full load factor (FLF) - average number of elements across full buckets\n\n"); + + fprintf (stdout, "Standard deviation (SD) is calculated for both the LF and FLF\n"); + fprintf (stdout, "and indicates the typical deviation of bucket chain length\n"); + fprintf (stdout, "from the value in the corresponding load factor.\n\n"); + + for (i = 0; i < array_size(vtysh_client); i++) + if ( vtysh_client[i].fd >= 0 ) { + ret = vtysh_client_execute (&vtysh_client[i], cmd, stdout); + fprintf (stdout, "\n"); + } + return ret; +} + DEFUNSH (VTYSH_ZEBRA, vtysh_link_params, vtysh_link_params_cmd, @@ -3576,6 +3603,8 @@ vtysh_init_vty (void) install_element (VIEW_NODE, &vtysh_show_work_queues_cmd); install_element (VIEW_NODE, &vtysh_show_work_queues_daemon_cmd); + install_element (VIEW_NODE, &vtysh_show_hashtable_cmd); + install_element (VIEW_NODE, &vtysh_show_thread_cmd); /* Logging */ |