perfmon plugin: 2-way parallel stat collection 61/17061/2
authorDave Barach <dave@barachs.net>
Thu, 24 Jan 2019 15:34:24 +0000 (10:34 -0500)
committerDamjan Marion <dmarion@me.com>
Thu, 24 Jan 2019 16:19:04 +0000 (16:19 +0000)
commitec595ef02639005b34334097af76b41ceef3dca5
treeb8b752d9c9371b9ea75a9a28bfa1a3a6e7494b18
parent22f23ae802f6dc654dbef27340c67773eb8be8c3
perfmon plugin: 2-way parallel stat collection

As a FUD reduction measure, this patch implements 2-way parallel
counter collection. Synthetic stat component counter pairs run at the
same time. Running two counters (of any kind) at the same time
naturally reduces the aggregate time required by an approximate
factor-of-2, depending on whether an even or odd number of stats have
been requested.

I don't completely buy the argument that computing synthetic stats
such as instructions-per-clock will be inaccurate if component counter
values are collected sequentially. Given uniform traffic pattern, it
must make no difference.

As the collection interval increases, the difference between serial
and parallel component counter collection will approach zero, see also
the Central Limit theorem.

Change-Id: I36ebdcf125e8882cca8a1929ec58f17fba1ad8f1
Signed-off-by: Dave Barach <dave@barachs.net>
src/plugins/perfmon/perfmon.c
src/plugins/perfmon/perfmon.h
src/plugins/perfmon/perfmon_periodic.c
src/vlib/main.c
src/vlib/main.h
src/vlib/node.h
src/vlib/node_cli.c
src/vlibapi/node_serialize.c