diff --git a/orchagent/portsorch.cpp b/orchagent/portsorch.cpp old mode 100644 new mode 100755 index 5cf11cfc1c..b5ef8d934c --- a/orchagent/portsorch.cpp +++ b/orchagent/portsorch.cpp @@ -147,6 +147,12 @@ PortsOrch::PortsOrch(DBConnector *db, vector &tableNames) m_counter_db = shared_ptr(new DBConnector(COUNTERS_DB, DBConnector::DEFAULT_UNIXSOCKET, 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)); @@ -2849,6 +2855,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; } @@ -2884,6 +2895,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 4e4100348a..db7e3d6605 --- a/orchagent/portsorch.h +++ b/orchagent/portsorch.h @@ -87,6 +87,7 @@ class PortsOrch : public Orch, public Subject bool removeAclTableGroup(const Port &p); private: unique_ptr
m_counterTable; + unique_ptr
m_counterLagTable; unique_ptr
m_portTable; unique_ptr
m_queueTable; unique_ptr
m_queuePortTable;