From d6c40e56f04c34362e28cfd6b1c058a2ee11d16a Mon Sep 17 00:00:00 2001 From: Dong Zhang <41927498+dzhangalibaba@users.noreply.github.com> Date: Mon, 1 Jun 2020 12:55:21 -0700 Subject: [PATCH] [MultiDB] use get API to obtain dbid instead of hardcode value (#618) * [MultiDB] use get API to obtain dbid instead of hardcode value --- syncd/FlexCounter.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/syncd/FlexCounter.cpp b/syncd/FlexCounter.cpp index ad481534723c..5436018e3c4f 100644 --- a/syncd/FlexCounter.cpp +++ b/syncd/FlexCounter.cpp @@ -1448,13 +1448,13 @@ void FlexCounter::collectBufferPoolCounters( } void FlexCounter::runPlugins( - _In_ swss::DBConnector& db) + _In_ swss::DBConnector& counters_db) { SWSS_LOG_ENTER(); const std::vector argv = { - std::to_string(COUNTERS_DB), // TODO + std::to_string(counters_db.getDbId()), COUNTERS_TABLE, std::to_string(m_pollInterval * 1000) }; @@ -1470,7 +1470,7 @@ void FlexCounter::runPlugins( for (const auto& sha : m_portPlugins) { - runRedisScript(db, sha, portList, argv); + runRedisScript(counters_db, sha, portList, argv); } std::vector queueList; @@ -1484,7 +1484,7 @@ void FlexCounter::runPlugins( for (const auto& sha : m_queuePlugins) { - runRedisScript(db, sha, queueList, argv); + runRedisScript(counters_db, sha, queueList, argv); } std::vector priorityGroupList; @@ -1498,7 +1498,7 @@ void FlexCounter::runPlugins( for (const auto& sha : m_priorityGroupPlugins) { - runRedisScript(db, sha, priorityGroupList, argv); + runRedisScript(counters_db, sha, priorityGroupList, argv); } std::vector bufferPoolVids; @@ -1512,7 +1512,7 @@ void FlexCounter::runPlugins( for (const auto& sha : m_bufferPoolPlugins) { - runRedisScript(db, sha, bufferPoolVids, argv); + runRedisScript(counters_db, sha, bufferPoolVids, argv); } }