diff options
Diffstat (limited to 'src/rpc-server/commands/trex_rpc_cmd_general.cpp')
-rw-r--r-- | src/rpc-server/commands/trex_rpc_cmd_general.cpp | 13 |
1 files changed, 2 insertions, 11 deletions
diff --git a/src/rpc-server/commands/trex_rpc_cmd_general.cpp b/src/rpc-server/commands/trex_rpc_cmd_general.cpp index 7721526c..3a0a12f8 100644 --- a/src/rpc-server/commands/trex_rpc_cmd_general.cpp +++ b/src/rpc-server/commands/trex_rpc_cmd_general.cpp @@ -22,6 +22,7 @@ limitations under the License. #include "trex_rpc_cmds.h" #include <trex_rpc_server_api.h> #include <trex_stateless_api.h> +#include <trex_stateless_port.h> #include <trex_rpc_cmds_table.h> #include <fstream> @@ -271,17 +272,7 @@ TrexRpcCmdGetPortStats::_run(const Json::Value ¶ms, Json::Value &result) { result["result"]["status"] = port->get_state_as_string(); - result["result"]["tx_bps"] = Json::Value::UInt64(port->get_stats().m_stats.tx_bps); - result["result"]["tx_pps"] = Json::Value::UInt64(port->get_stats().m_stats.tx_pps); - result["result"]["total_tx_pkts"] = Json::Value::UInt64(port->get_stats().m_stats.total_tx_pkts); - result["result"]["total_tx_bytes"] = Json::Value::UInt64(port->get_stats().m_stats.total_tx_bytes); - - result["result"]["rx_bps"] = Json::Value::UInt64(port->get_stats().m_stats.rx_bps); - result["result"]["rx_pps"] = Json::Value::UInt64(port->get_stats().m_stats.rx_pps); - result["result"]["total_rx_pkts"] = Json::Value::UInt64(port->get_stats().m_stats.total_rx_pkts); - result["result"]["total_rx_bytes"] = Json::Value::UInt64(port->get_stats().m_stats.total_rx_bytes); - - result["result"]["tx_rx_error"] = Json::Value::UInt64(port->get_stats().m_stats.tx_rx_errors); + port->encode_stats(result["result"]); return (TREX_RPC_CMD_OK); } |