summaryrefslogtreecommitdiffstats
path: root/src/flow_stat.cpp
diff options
context:
space:
mode:
authorIdo Barnea <ibarnea@cisco.com>2016-04-07 17:23:33 +0300
committerIdo Barnea <ibarnea@cisco.com>2016-04-07 17:23:33 +0300
commit9e59c6af96e177a2ea022da80de6c408286321eb (patch)
tree162f40296bba3ecf945857b09af18dfdc884d435 /src/flow_stat.cpp
parent106f14c2026638d9277e2dfc8649e5caa3164da1 (diff)
Do not send RX bytes in json if HW type does not support it
Diffstat (limited to 'src/flow_stat.cpp')
-rw-r--r--src/flow_stat.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/flow_stat.cpp b/src/flow_stat.cpp
index 13f8eb16..10b0c3ea 100644
--- a/src/flow_stat.cpp
+++ b/src/flow_stat.cpp
@@ -845,7 +845,8 @@ bool CFlowStatRuleMgr::dump_json(std::string & json, bool baseline) {
if (user_id_info->need_to_send_rx(port) || baseline) {
user_id_info->set_no_need_to_send_rx(port);
data_section[str_user_id]["rx_pkts"][str_port] = Json::Value::UInt64(user_id_info->get_rx_counter(port).get_pkts());
- data_section[str_user_id]["rx_bytes"][str_port] = Json::Value::UInt64(user_id_info->get_rx_counter(port).get_bytes());
+ if (m_capabilities & TrexPlatformApi::IF_STAT_RX_BYTES_COUNT)
+ data_section[str_user_id]["rx_bytes"][str_port] = Json::Value::UInt64(user_id_info->get_rx_counter(port).get_bytes());
send_empty = false;
}
if (user_id_info->need_to_send_tx(port) || baseline) {