diff options
Diffstat (limited to 'src/main_dpdk.cpp')
-rwxr-xr-x | src/main_dpdk.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/main_dpdk.cpp b/src/main_dpdk.cpp index b9fee6bd..d4e07ef2 100755 --- a/src/main_dpdk.cpp +++ b/src/main_dpdk.cpp @@ -3810,7 +3810,13 @@ void CGlobalTRex::get_stats(CGlobalStats & stats){ stats.m_total_clients = total_clients; stats.m_total_servers = total_servers; stats.m_active_sockets = active_sockets; - stats.m_socket_util =100.0*(double)active_sockets/(double)total_sockets; + + if (total_sockets != 0) { + stats.m_socket_util =100.0*(double)active_sockets/(double)total_sockets; + } else { + stats.m_socket_util = 0; + } + float drop_rate=total_tx-total_rx; |