diff --git a/orchagent/portsorch.cpp b/orchagent/portsorch.cpp old mode 100644 new mode 100755 index 3191dddbf627..73f3203d5128 --- a/orchagent/portsorch.cpp +++ b/orchagent/portsorch.cpp @@ -164,6 +164,12 @@ PortsOrch::PortsOrch(DBConnector *db, vector &tableNames) m_counter_db = shared_ptr(new DBConnector("COUNTERS_DB", 0)); m_counterTable = unique_ptr(new Table(m_counter_db.get(), COUNTERS_PORT_NAME_MAP)); + m_counterLagTable = unique_ptr
(new Table(m_counter_db.get(), COUNTERS_LAG_NAME_MAP)); + FieldValueTuple tuple("", ""); + vector defaultLagFv; + defaultLagFv.push_back(tuple); + m_counterLagTable->set("", defaultLagFv); + /* Initialize port table */ m_portTable = unique_ptr
(new Table(db, APP_PORT_TABLE_NAME)); @@ -3247,6 +3253,11 @@ bool PortsOrch::addLag(string lag_alias) PortUpdate update = { lag, true }; notify(SUBJECT_TYPE_PORT_CHANGE, static_cast(&update)); + FieldValueTuple tuple(lag_alias, sai_serialize_object_id(lag_id)); + vector fields; + fields.push_back(tuple); + m_counterLagTable->set("", fields); + return true; } @@ -3291,6 +3302,8 @@ bool PortsOrch::removeLag(Port lag) PortUpdate update = { lag, false }; notify(SUBJECT_TYPE_PORT_CHANGE, static_cast(&update)); + m_counterLagTable->hdel("", lag.m_alias); + return true; } diff --git a/orchagent/portsorch.h b/orchagent/portsorch.h old mode 100644 new mode 100755 index 72444c549ace..8d0840dda834 --- a/orchagent/portsorch.h +++ b/orchagent/portsorch.h @@ -94,6 +94,7 @@ class PortsOrch : public Orch, public Subject bool removeSubPort(const string &alias); private: unique_ptr
m_counterTable; + unique_ptr
m_counterLagTable; unique_ptr
m_portTable; unique_ptr
m_queueTable; unique_ptr
m_queuePortTable;