Hi friend!
You can configure the traffic policy with a behavior of statistics.
Please see below:
[Switch] acl 4000
[Switch-acl-L2-4000] rule permit xx
[Switch] traffic classifier c1 operator and
[Switch-classifier-c1] if-match acl 4000
[Switch] traffic behavior b1
[Switch-behavior-b1] statistic enable
[Switch-behavior-b1] quit
[Switch] traffic policy p1
[Switch-trafficpolicy-p1] classifier c1 behavior b1
[Switch] interface gigabitethernet 0/0/1.x
[Switch-GigabitEthernet0/0/1] traffic-policy p1 inbound
[Switch-GigabitEthernet0/0/1] quit