The statistic enable command enables the traffic statistics function in a traffic behavior.
The undo statistic enable command disables the traffic statistics function in a traffic behavior.
By default, the traffic statistics function in a traffic behavior is disabled.
Usage Scenario
To view the statistics on packets matching a traffic policy, you can use the statistic enable command to enable the statistics function. After the statistics function is enabled, you can use the display traffic policy statistics command to view the statistics.
Precautions
If only statistic enable is configured in a traffic behavior, the S2720-EI, S5720I-SI, S5720-LI, S5720S-LI, S5720S-SI, S5720-SI, S5730S-EI, S5730-SI, S6720-LI, S6720S-LI, S6720S-SI, and S6720-SI support packet-based traffic statistics but not byte-based traffic statistics. After the traffic statistics mode by-bytes command is configured in the system view and traffic statistics is configured in a traffic policy, the switches support byte-based traffic statistics.
For the S5720-HI, S5730-HI, S5731-H, S5731-S, S5731S-H, S5731S-S, S5732-H, S6720-HI, S6730-H, S6730S-H, S6730-S, and S6730S-S, if a traffic policy defining traffic statistics is applied to an Eth-Trunk in the outbound direction, traffic statistics does not take effect for the packets sent by the CPU. In this case, you can configure traffic statistics or port mirroring in the inbound direction on the interface connected to the Eth-Trunk.
Follow-up Procedure
Run the traffic policy command to create a traffic policy and run the classifier behavior command in the traffic policy view to bind the traffic classifier to the traffic behavior containing the traffic statistics collection function.