summaryrefslogtreecommitdiffstats
path: root/src/vlib/main.h
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/main.h
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/main.h')
-rw-r--r--src/vlib/main.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/vlib/main.h b/src/vlib/main.h
index af6539efc75..0e65c817ae1 100644
--- a/src/vlib/main.h
+++ b/src/vlib/main.h
@@ -251,6 +251,14 @@ typedef struct vlib_main_t
*/
int need_vlib_worker_thread_node_runtime_update;
+ /* Dispatch loop time accounting */
+ u64 loops_this_reporting_interval;
+ f64 loop_interval_end;
+ f64 loop_interval_start;
+ f64 loops_per_second;
+ f64 seconds_per_loop;
+ f64 damping_constant;
+
/*
* Barrier epoch - Set to current time, each time barrier_sync or
* barrier_release is called with zero recursion.