Skip to content

stats: add support for histogram type - #349

Merged
ondrej-fabry merged 1 commit into
FDio:masterfrom
hsandid:histogram-stats
Mar 19, 2026
Merged

ondrej-fabry merged 1 commit into
FDio:masterfrom
hsandid:histogram-stats

Conversation

@hsandid

@hsandid hsandid commented Mar 17, 2026

Copy link
Copy Markdown
Contributor

Hello,

This PR adds support for histogram entries recently introduced as part of VPP stats-segment (https://gerrit.fd.io/r/c/vpp/+/43471).

This updates statseg_v2 to be able to fetch histogram information (min_exp, bins). The stats-client can also be now be used to poll/dump histogram information.

I've tested using the following:

# Creating histogram in VPP stats-segment using CLI command
# "test stats histogram-gen <name> <count> <interval-usec> [min-exp] [num-bins]"
vpp# test stats histogram-gen /test/my_hist 1000 100 0 16

# Using govpp stats-client to dump histogram information
➜  govpp-personal git:(histogram-stats) bin/stats-client dump /test/my_hist
Dumping stats.. /test/my_hist
 - /test/my_hist                                                  HistogramLog2
  [thread 0]: min_exp=0
    <= 1: 42 (cumulative: 42)
    <= 2: 0 (cumulative: 42)
    <= 4: 42 (cumulative: 84)
    <= 8: 84 (cumulative: 168)
    <= 16: 10 (cumulative: 178)
    <= 32: 28 (cumulative: 206)
    <= 64: 40 (cumulative: 246)
    <= 128: 88 (cumulative: 334)
    <= 256: 42 (cumulative: 376)
    <= 512: 86 (cumulative: 462)
    <= 1024: 38 (cumulative: 500)
    <= 2048: 0 (cumulative: 500)
    <= 4096: 168 (cumulative: 668)
    <= 8192: 0 (cumulative: 668)
    <= 16384: 0 (cumulative: 668)
    <= 32768: 0 (cumulative: 668)
 [thread 1]: min_exp=0
...

Signed-off-by: Hadi Sandid <hadisandid@gmail.com>

@ondrej-fabry ondrej-fabry left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@ondrej-fabry
ondrej-fabry merged commit df5fc5d into FDio:master Mar 19, 2026
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants