File tree 2 files changed +38
-0
lines changed
2 files changed +38
-0
lines changed Original file line number Diff line number Diff line change @@ -1016,6 +1016,38 @@ void FlexCounter::removeFlowCounter(
1016
1016
}
1017
1017
}
1018
1018
1019
+ string FlexCounter::getRifCounterTableKey (string key)
1020
+ {
1021
+ SWSS_LOG_ENTER ();
1022
+ return " COUNTERS:" + key;
1023
+ }
1024
+
1025
+ string FlexCounter::getRifRateTableKey (string key)
1026
+ {
1027
+ SWSS_LOG_ENTER ();
1028
+ return " RATES:" + key;
1029
+ }
1030
+
1031
+ string FlexCounter::getRifRateInitTableKey (string key)
1032
+ {
1033
+ SWSS_LOG_ENTER ();
1034
+ return " RATES:" + key + " :RIF" ;
1035
+ }
1036
+
1037
+ void FlexCounter::cleanUpRifFromCounterDb (_In_ sai_object_id_t rifId)
1038
+ {
1039
+ SWSS_LOG_ENTER ();
1040
+ const auto id = sai_serialize_object_id (rifId);
1041
+ swss::DBConnector db (m_dbCounters, 0 );
1042
+ string counter_key = getRifCounterTableKey (id);
1043
+ string rate_key = getRifRateTableKey (id);
1044
+ string rate_init_key = getRifRateInitTableKey (id);
1045
+ db.del (counter_key);
1046
+ db.del (rate_key);
1047
+ db.del (rate_init_key);
1048
+ SWSS_LOG_NOTICE (" CleanUp oid %s from counter db" , id.c_str ());
1049
+ }
1050
+
1019
1051
void FlexCounter::removeRif (
1020
1052
_In_ sai_object_id_t rifVid)
1021
1053
{
@@ -1030,6 +1062,7 @@ void FlexCounter::removeRif(
1030
1062
}
1031
1063
1032
1064
m_rifCounterIdsMap.erase (it);
1065
+ cleanUpRifFromCounterDb (rifVid);
1033
1066
1034
1067
if (m_rifCounterIdsMap.empty ())
1035
1068
{
Original file line number Diff line number Diff line change @@ -50,6 +50,11 @@ namespace syncd
50
50
51
51
bool isDiscarded ();
52
52
53
+ std::string getRifCounterTableKey (std::string s);
54
+ std::string getRifRateTableKey (std::string s);
55
+ std::string getRifRateInitTableKey (std::string s);
56
+ void cleanUpRifFromCounterDb (_In_ sai_object_id_t rifId);
57
+
53
58
private:
54
59
55
60
void setPollInterval (
You can’t perform that action at this time.
0 commit comments