Skip to content

Commit

Permalink
Change vid db format for counters (sonic-net#57)
Browse files Browse the repository at this point in the history
  • Loading branch information
kcudnik authored and stcheng committed Aug 16, 2016
1 parent 15ba1cb commit 2417121
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions syncd/syncd_counters.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#include "syncd.h"
#include <condition_variable>
#include <sstream>

void collectCounters(swss::Table &countersTable,
const std::vector<sai_port_stat_counter_t> &supportedCounters)
Expand Down Expand Up @@ -36,6 +37,11 @@ void collectCounters(swss::Table &countersTable,
std::string strPortId;
sai_serialize_primitive(vid, strPortId);

// for counters, use port vid as printf "%llx" format
std::stringstream ss;
ss << std::hex << vid;
strPortId = ss.str();

std::vector<swss::FieldValueTuple> values;

for (size_t idx = 0; idx < counters.size(); idx++)
Expand Down

0 comments on commit 2417121

Please sign in to comment.