sonic-net / DASH

Disaggregated APIs for SONiC Hosts
Apache License 2.0
78 stars 88 forks source link

[sai-gen] Add counter id generation support for counters. #503

Closed r12f closed 6 months ago

r12f commented 6 months ago

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. 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

chrispsommers commented 6 months ago

Perhaps you explain this is in the WG mtg, you've made a number of enhancements recently and I think it'd be good to review for the community. Thx.

r12f commented 6 months ago

yea! that sounds great to me! i can do a summary on how the latest SAI generator works and all the enhancements I did recently (so far, I still won't call it new, since the basic logic is still the same :D)

not sure if tomorrow is a good time, if not, next next week should be good, if we have time.

r12f commented 6 months ago

Woot! Thank you so much, Chris!