summaryrefslogtreecommitdiffstats
path: root/src/vlib/node_cli.c
diff options
context:
space:
mode:
authorDave Barach <dave@barachs.net>2019-10-04 09:59:00 -0400
committerAndrew Yourtchenko <ayourtch@gmail.com>2019-10-18 14:37:53 +0000
commit95c5e32b16d5a9fe65b95c46ce638d5670a5a2ba (patch)
treeebca21cdc660ed293292246aa01246e9215433e1 /src/vlib/node_cli.c
parent47c6f36be723f0e02e9a842701d7ca63dfcb8b94 (diff)
misc: add "show run summary"
Prints the interior node vector rate, rx / tx / drop rates Type: feature Signed-off-by: Dave Barach <dave@barachs.net> Change-Id: I57130db0f99e852a8498aa90d01e52f7ac33dcc9 (cherry picked from commit ac78f8a902fc61465edf657f7c7da7ff575210c8)
Diffstat (limited to 'src/vlib/node_cli.c')
-rw-r--r--src/vlib/node_cli.c30
1 files changed, 19 insertions, 11 deletions
diff --git a/src/vlib/node_cli.c b/src/vlib/node_cli.c
index 5f0617d7eae..32c6c1a4ef9 100644
--- a/src/vlib/node_cli.c
+++ b/src/vlib/node_cli.c
@@ -335,6 +335,7 @@ show_node_runtime (vlib_main_t * vm,
u64 n_internal_vectors, n_internal_calls;
u64 n_clocks, l, v, c, d;
int brief = 1;
+ int summary = 0;
int max = 0;
vlib_main_t **stat_vms = 0, *stat_vm;
@@ -345,6 +346,9 @@ show_node_runtime (vlib_main_t * vm,
brief = 0;
if (unformat (input, "max") || unformat (input, "m"))
max = 1;
+ if (unformat (input, "summary") || unformat (input, "sum")
+ || unformat (input, "su"))
+ summary = 1;
for (i = 0; i < vec_len (vlib_mains); i++)
{
@@ -446,19 +450,23 @@ show_node_runtime (vlib_main_t * vm,
(f64) n_input / dt,
(f64) n_output / dt, (f64) n_drop / dt, (f64) n_punt / dt);
- vlib_cli_output (vm, "%U", format_vlib_node_stats, stat_vm, 0, max);
- for (i = 0; i < vec_len (nodes); i++)
+ if (summary == 0)
{
- c =
- nodes[i]->stats_total.calls -
- nodes[i]->stats_last_clear.calls;
- d =
- nodes[i]->stats_total.suspends -
- nodes[i]->stats_last_clear.suspends;
- if (c || d || !brief)
+ vlib_cli_output (vm, "%U", format_vlib_node_stats, stat_vm,
+ 0, max);
+ for (i = 0; i < vec_len (nodes); i++)
{
- vlib_cli_output (vm, "%U", format_vlib_node_stats, stat_vm,
- nodes[i], max);
+ c =
+ nodes[i]->stats_total.calls -
+ nodes[i]->stats_last_clear.calls;
+ d =
+ nodes[i]->stats_total.suspends -
+ nodes[i]->stats_last_clear.suspends;
+ if (c || d || !brief)
+ {
+ vlib_cli_output (vm, "%U", format_vlib_node_stats,
+ stat_vm, nodes[i], max);
+ }
}
}
vec_free (nodes);