stats: histogram, gauge and ring buffer types 71/43471/11
authorOle Troan <[email protected]>
Wed, 23 Jul 2025 10:46:49 +0000 (12:46 +0200)
committerDamjan Marion <[email protected]>
Fri, 26 Sep 2025 09:56:43 +0000 (09:56 +0000)
commit7a2a07911525e5ccf9e6dc4196dd90b2df99a9c2
tree607cadfb67e8aa81d0a493b6e76edb56d92b9d0b
parente95c1657798b5ad76a6c885b093df18a4f7e9754
stats: histogram, gauge and ring buffer types

A new log2 histogram type with prometheus exporter support.
min_exp can be set in the first element to adjust the bins.

The ring buffer is intended for exporting records to a client side
reader. If the reader cannot keep up the writer will overwrite oldest
entry.

Added a new gauge type, which is like scalar index, but being
explicit allows the prometheus exported to set type corretly.

Type: improvement
Change-Id: Ibe1244f28e01eee8d61a3ca6edb6fd1801f1c942
Signed-off-by: Ole Troan <[email protected]>
Change-Id: I1a6046c6962d67db8c510a571e9414723acbbd7e
Signed-off-by: Ole Troan <[email protected]>
16 files changed:
src/plugins/unittest/CMakeLists.txt
src/plugins/unittest/histogram_test.c [new file with mode: 0644]
src/plugins/unittest/ring_buffer_test.c [new file with mode: 0644]
src/vlib/counter.c
src/vlib/counter.h
src/vlib/stats/cli.c
src/vlib/stats/shared.h
src/vlib/stats/stats.c
src/vlib/stats/stats.h
src/vpp-api/client/stat_client.c
src/vpp-api/client/stat_client.h
src/vpp-api/python/vpp_papi/vpp_stats.py
src/vpp/app/vpp_get_stats.c
src/vpp/app/vpp_prometheus_export.c
test/test_ring_buffer.py [new file with mode: 0644]
test/test_ring_buffer_simple.py [new file with mode: 0644]