Skip to content

Commit

Permalink
Add Flex counters bulk Dash meter stats fetch support in syncd
Browse files Browse the repository at this point in the history
This PR adds syncd FlexCounter support to periodically fetch
SAI bulk stats for Dash meter buckets and write the stats to
COUNTERS_DB.
Multiple Meter buckets, each with inbound and outbound byte counters,
are internally allocated for each ENI object in the Dash pipeline.
To support this a new DashMeterCounterContext class is derived from
BaseCounterContext that tracks and invokes SAI bulkGetStats for all the
meter bucket objects for each ENI object added to the context.

Reference -
https://github.com/sonic-net/DASH/blob/main/documentation/metering/metering.md

Signed-off-by: Mukesh MV <[email protected]>
  • Loading branch information
mukeshmv committed Nov 24, 2024
1 parent e6ec142 commit 79201f8
Show file tree
Hide file tree
Showing 4 changed files with 640 additions and 0 deletions.
8 changes: 8 additions & 0 deletions meta/SaiSerialize.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1096,6 +1096,14 @@ std::string sai_serialize_eni_stat(
return sai_serialize_enum(counter, &sai_metadata_enum_sai_eni_stat_t);
}

std::string sai_serialize_meter_bucket_entry_stat(
_In_ const sai_meter_bucket_entry_stat_t counter)
{
SWSS_LOG_ENTER();

return sai_serialize_enum(counter, &sai_metadata_enum_sai_meter_bucket_entry_stat_t);
}

std::string sai_serialize_tunnel_stat(
_In_ const sai_tunnel_stat_t counter)
{
Expand Down
3 changes: 3 additions & 0 deletions meta/sai_serialize.h
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,9 @@ std::string sai_serialize_buffer_pool_stat(
std::string sai_serialize_eni_stat(
_In_ const sai_eni_stat_t counter);

std::string sai_serialize_meter_bucket_entry_stat(
_In_ const sai_meter_bucket_entry_stat_t counter);

std::string sai_serialize_tunnel_stat(
_In_ const sai_tunnel_stat_t counter);

Expand Down
Loading

0 comments on commit 79201f8

Please sign in to comment.