Hi Elias,

> Thanks for explaining!
> I'm sorry if what I wrote before was wrong or confusing.

no, not at all!

>> Checking counters values in the stats segment has _no_ impact on VPP.
>> VPP writes those counters regardless of reader frequency.
> 
> That's great!
> 
> Just to be clear, to make sure I understand what this means, if we do
> the following in python:
> 
> from vpp_papi.vpp_stats import VPPStats
> stat = VPPStats("/run/vpp/stats.sock")
> dir = stat.ls(['^/nat44/total-users'])
> counters = stat.dump(dir)
> list_of_counters=counters.get('/nat44/total-users')
> 
> (followed by a loop in python to sum up the counter values from
> different vpp threads) then what we are doing is that we are checking
> counters values in the stats segment, so there should be no impact on
> VPP?

Yes, that is correct.
(Of course depending on how pedantic you want to be there is an extra load on 
the memory hierarchy by client reading, which may in turn affect VPP.)

The actual VPP counter is exposed directly in shared memory. No copying or 
locking from VPP side.
The client uses optimistic locking, meaning that it will retry copying out the 
counter if the underlaying stat segment directory structure has changed.

Best regards,
Ole
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.

View/Reply Online (#15748): https://lists.fd.io/g/vpp-dev/message/15748
Mute This Topic: https://lists.fd.io/mt/71882379/21656
Group Owner: vpp-dev+ow...@lists.fd.io
Unsubscribe: https://lists.fd.io/g/vpp-dev/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to