Check the packet counter on simple switch port

I wanted to see the packet count on the simple_switch_grpc switch ports. I could not find right way to do it. Please help me with getting the packet count on a specific port with p4runtime on simple switch. Thanks!

The only counters that can be accessed using the p4runtime API on a P4 program are those explicitly written into the P4 program itself. There are no port packet/byte counters “by default” in a P4 program.

If you write P4 code to maintain packet & byte counts for all packets received on a port, and/or all packets sent to a port, then you can use the p4runtime API to read those counter values, explicitly defined in your P4 code, by the name that you chose to give them.