Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[FlexCounter] Refactor FlexCounter class (sonic-net#1073)
HLD: sonic-net/SONiC#1020 **Why I did it?** FlexCounter class is a representation of flex counter group which supports querying multiple types of statistic/attributes. It supports multiple statistic/attribute types such as port counter, port debug counter, queue counter, queue attribute and so on. For each statistic/attribute type, it defines several member functions: - setXXXCounterList: e.g. setPortCounterList, setPortDebugCounterList - removeXXX: e.g. removePort, removeQueue - collectXXXCounters: e.g. collectPortCounters, collectQueueCounters - collectXXXAttr: e.g. collectQueueAttrs, collectPriorityGroupAttrs - so on - For different statistic/attribute types, these functions have very similar logic. This PR moved similar logic to single place to avoid redundant code. **How I test it?** Almost full unit test coverage of newly added code.
- Loading branch information