Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[sai-gen] Add counter id generation support for counters. (sonic-net#503
) ## Problem Currently, DASH only supports generating counters as SAI attributes upon DASH APIs, such as metering buckets. This might be ok for new things that has dedicated DASH concepts, i.e., metering buckets. However, for other more generic counters used for collecting telemetry, this approach could leads to feature missing and not fully utilizing what we already have in SAI and SONiC. For example, no get-and-reset operation support and need to build dedicated pipeline for pulling the counters and feeds them into the telemetry. ## What are we doing in this change This change adds support to generate the counters as [SAI generic counters](https://github.com/opencomputeproject/SAI/blob/master/doc/SAI-Proposal-Generic-Counters.md). Instead of generate the counters as readonly attributes, we generate a counter id for it. Then, we can leverage all the infrastructure already built for counters. As the screenshot shows below, after removing `as_attr="true"` for metering_bucket_outbound, a counter id will be generated instead of an readonly counter attribute. It also supports handling the packets-and-bytes counter too, because generic counter already collects both information. ![image](https://github.com/sonic-net/DASH/assets/1533278/aa40224b-8b45-48c1-8233-14345dff6bb8)
- Loading branch information