diff --git a/orchagent/flexcounterorch.cpp b/orchagent/flexcounterorch.cpp index 41f024c639fd..51c9c9325a65 100644 --- a/orchagent/flexcounterorch.cpp +++ b/orchagent/flexcounterorch.cpp @@ -86,6 +86,12 @@ void FlexCounterOrch::doTask(Consumer &consumer) if (op == SET_COMMAND) { + auto it = std::find(std::begin(data), std::end(data), FieldValueTuple(FLEX_COUNTER_DELAY_STATUS_FIELD, "true")); + + if (it != data.end()) + { + continue; + } for (auto valuePair:data) { const auto &field = fvField(valuePair); @@ -144,6 +150,12 @@ void FlexCounterOrch::doTask(Consumer &consumer) fieldValues.emplace_back(FLEX_COUNTER_STATUS_FIELD, value); m_flexCounterGroupTable->set(flexCounterGroupMap[key], fieldValues); } + else if(field == FLEX_COUNTER_DELAY_STATUS_FIELD) + { + // This field is ignored since it is being used before getting into this loop. + // If it is exist and the value is 'true' we need to skip the iteration in order to delay the counter creation. + // The field will clear out and counter will be created when enable_counters script is called. + } else { SWSS_LOG_NOTICE("Unsupported field %s", field.c_str());