You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[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.
0 commit comments