summaryrefslogtreecommitdiffstats
path: root/src/vlib/node_cli.c
diff options
context:
space:
mode:
authorDave Barach <dave@barachs.net>2020-02-17 17:07:12 -0500
committerFlorin Coras <florin.coras@gmail.com>2020-02-18 18:42:22 +0000
commit000a029e4a6a481f35b978dfe474c82d8da88e95 (patch)
tree287b547c120b95f6b93dc9e2556fc68e52b82cf1 /src/vlib/node_cli.c
parentff19e3bf4fc10d17e3bafa798e6048ad473c6bd8 (diff)
vlib: calculate per-worker loops/second metric
Use exponential smoothing. Each sample has a half-life of 1 second. reported_rate(t) = reported_rate(t-1) * K + rate(t)*(1-K) Sample every 20ms, i.e. 50 samples per second K = exp (-1.0/20.0); K = 0.95; Type: feature Signed-off-by: Dave Barach <dave@barachs.net> Change-Id: I9aea5dd5fecfaefffb78245316adb4bf62eb2bd4
Diffstat (limited to 'src/vlib/node_cli.c')
-rw-r--r--src/vlib/node_cli.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/vlib/node_cli.c b/src/vlib/node_cli.c
index bf18702d582..1ba0575f182 100644
--- a/src/vlib/node_cli.c
+++ b/src/vlib/node_cli.c
@@ -442,11 +442,12 @@ show_node_runtime (vlib_main_t * vm,
dt = time_now - nm->time_last_runtime_stats_clear;
vlib_cli_output
(vm,
- "Time %.1f, %f sec internal node vector rate %.2f \n"
+ "Time %.1f, %f sec internal node vector rate %.2f loops/sec %.2f\n"
" vector rates in %.4e, out %.4e, drop %.4e, punt %.4e",
dt,
vlib_get_stat_segment_update_rate (),
internal_node_vector_rates[j],
+ stat_vm->loops_per_second,
(f64) n_input / dt,
(f64) n_output / dt, (f64) n_drop / dt, (f64) n_punt / dt);