diff --git a/lib/Recorder.cpp b/lib/Recorder.cpp index 6c9ebd721..1ba3828d9 100644 --- a/lib/Recorder.cpp +++ b/lib/Recorder.cpp @@ -535,6 +535,17 @@ void Recorder::recordGenericSet( recordLine("s|" + key + "|" + Globals::joinFieldValues(arguments)); } +void Recorder::recordGenericCounterPolling( + _In_ const std::string& key, + _In_ const std::vector& arguments) +{ + SWSS_LOG_ENTER(); + + // lower case 'p' stands for counter Polling + + recordLine("p|" + key + "|" + Globals::joinFieldValues(arguments)); +} + void Recorder::recordGenericSetResponse( _In_ sai_status_t status) { diff --git a/lib/Recorder.h b/lib/Recorder.h index da1f8fe7e..f30c22b9d 100644 --- a/lib/Recorder.h +++ b/lib/Recorder.h @@ -179,6 +179,10 @@ namespace sairedis public: // SAI stats API + void recordGenericCounterPolling( + _In_ const std::string& key, + _In_ const std::vector& arguments); + void recordGenericGetStats( _In_ sai_object_type_t object_type, _In_ sai_object_id_t object_id, diff --git a/lib/RedisRemoteSaiInterface.cpp b/lib/RedisRemoteSaiInterface.cpp index cbd8118b6..4c0247109 100644 --- a/lib/RedisRemoteSaiInterface.cpp +++ b/lib/RedisRemoteSaiInterface.cpp @@ -572,7 +572,7 @@ sai_status_t RedisRemoteSaiInterface::notifyCounterGroupOperations( emplaceStrings(flexCounterGroupParam->plugin_name, flexCounterGroupParam->plugins, entries); emplaceStrings(FLEX_COUNTER_STATUS_FIELD, flexCounterGroupParam->operation, entries); - m_recorder->recordGenericSet(key, entries); + m_recorder->recordGenericCounterPolling(key, entries); m_communicationChannel->set(key, entries, @@ -607,7 +607,7 @@ sai_status_t RedisRemoteSaiInterface::notifyCounterOperations( command = REDIS_FLEX_COUNTER_COMMAND_STOP_POLL; } - m_recorder->recordGenericSet(key, entries); + m_recorder->recordGenericCounterPolling(key, entries); m_communicationChannel->set(key, entries, command); return waitForResponse(SAI_COMMON_API_SET); diff --git a/saiplayer/SaiPlayer.cpp b/saiplayer/SaiPlayer.cpp index 915c0e10c..700fb25b8 100644 --- a/saiplayer/SaiPlayer.cpp +++ b/saiplayer/SaiPlayer.cpp @@ -2607,6 +2607,9 @@ int SaiPlayer::replay() case 'q': // TODO: implement SAI player support for query commands continue; + case 'p': + // TODO: implement SAI player support for counter polling commands + continue; case 'Q': continue; // skip over query responses case '#': diff --git a/tests/MLNX2700/full_no_hostif_entry.rec b/tests/MLNX2700/full_no_hostif_entry.rec index 95d8416a3..f0feac4a8 100644 --- a/tests/MLNX2700/full_no_hostif_entry.rec +++ b/tests/MLNX2700/full_no_hostif_entry.rec @@ -49647,3 +49647,10 @@ 2017-05-11.01:45:41.511250|r|SAI_OBJECT_TYPE_NEXT_HOP_GROUP_MEMBER:oid:0x2d000000000656 2017-05-11.01:44:02.533119|a|APPLY_VIEW 2017-05-11.01:44:02.535313|A|SAI_STATUS_SUCCESS +2024-11-02.06:13:50.487652|p|BUFFER_POOL_WATERMARK_STAT_COUNTER|POLL_INTERVAL=60000|BUFFER_POOL_PLUGIN_LIST=78f7658e05f9659b8ecaf00eb0214957a509e246 +2024-11-02.06:14:06.920978|p|BUFFER_POOL_WATERMARK_STAT_COUNTER|STATS_MODE=STATS_MODE_READ_AND_CLEAR +2024-11-02.06:14:06.922388|p|BUFFER_POOL_WATERMARK_STAT_COUNTER:oid:0x1800000000069d|BUFFER_POOL_COUNTER_ID_LIST=SAI_BUFFER_POOL_STAT_WATERMARK_BYTES,SAI_BUFFER_POOL_STAT_XOFF_ROOM_WATERMARK_BYTES +2024-11-02.06:14:06.923907|p|BUFFER_POOL_WATERMARK_STAT_COUNTER:oid:0x1800000000069e|BUFFER_POOL_COUNTER_ID_LIST=SAI_BUFFER_POOL_STAT_WATERMARK_BYTES,SAI_BUFFER_POOL_STAT_XOFF_ROOM_WATERMARK_BYTES +2024-11-02.06:14:06.925866|p|BUFFER_POOL_WATERMARK_STAT_COUNTER:oid:0x1800000000069f|BUFFER_POOL_COUNTER_ID_LIST=SAI_BUFFER_POOL_STAT_WATERMARK_BYTES,SAI_BUFFER_POOL_STAT_XOFF_ROOM_WATERMARK_BYTES +2024-11-02.06:14:06.927241|p|BUFFER_POOL_WATERMARK_STAT_COUNTER:oid:0x180000000006a0|BUFFER_POOL_COUNTER_ID_LIST=SAI_BUFFER_POOL_STAT_WATERMARK_BYTES,SAI_BUFFER_POOL_STAT_XOFF_ROOM_WATERMARK_BYTES +2024-11-02.06:14:06.928549|p|BUFFER_POOL_WATERMARK_STAT_COUNTER|FLEX_COUNTER_STATUS=enable