ptf
ptf copied to clipboard
[feature wanted] thread safe method to flush counters in dataplane
We need a thread safe method to flush counters in dataplane, as there may many thread sharing the same dataplane instance:(https://github.com/p4lang/ptf/blob/c554f83685186be4cfa9387eb5d6d700d2bbd7c0/src/ptf/init.py#L20
Counters: https://github.com/p4lang/ptf/blob/c554f83685186be4cfa9387eb5d6d700d2bbd7c0/src/ptf/dataplane.py#L571-L575
Would something as straightforward as acquiring a lock around all accesses to rx_counters / tx_counters do what you are asking for? If so, are you interested in submitting a PR for review that does this?