diff --git a/parse_session_stats.py b/parse_session_stats.py index 1e5062a04..a22405b26 100755 --- a/parse_session_stats.py +++ b/parse_session_stats.py @@ -148,6 +148,7 @@ reports = [ ('uTP delay', 'buffering delay', 's', 'network delays measured by uTP', ['uTP peak send delay','uTP peak recv delay', 'uTP avg send delay', 'uTP avg recv delay']), ('uTP send delay histogram', 'buffering delay', 's', 'send delays measured by uTP', ['uTP avg send delay'], True), ('uTP recv delay histogram', 'buffering delay', 's', 'receive delays measured by uTP', ['uTP avg recv delay'], True), + ('uTP stats', 'num', 's', 'number of uTP sockets by state', ['uTP idle', 'uTP syn-sent', 'uTP connected', 'uTP fin-sent', 'uTP close-wait']), ('system memory', '', '', 'virtual memory page count', ['active resident pages', 'inactive resident pages', 'pinned resident pages', 'free pages']), ('memory paging', '', '', 'vm disk activity', ['pageins', 'pageouts']), ('page faults', '', '', '', ['page faults']), diff --git a/src/session_impl.cpp b/src/session_impl.cpp index 9cd4ba6a7..9bb4cda88 100644 --- a/src/session_impl.cpp +++ b/src/session_impl.cpp @@ -1201,6 +1201,11 @@ namespace aux { ":no memory peer errors" ":too many peers" ":transport timeout peers" + ":uTP idle" + ":uTP syn-sent" + ":uTP connected" + ":uTP fin-sent" + ":uTP close-wait" "\n\n", m_stats_logger); } #endif @@ -3654,6 +3659,7 @@ namespace aux { if (m_stats_logger) { cache_status cs = m_disk_thread.status(); + session_status sst = status(); m_read_ops.add_sample((cs.reads - m_last_cache_status.reads) * 1000.0 / float(tick_interval_ms)); m_write_ops.add_sample((cs.writes - m_last_cache_status.writes) * 1000.0 / float(tick_interval_ms)); @@ -3816,6 +3822,12 @@ namespace aux { STAT_LOG(d, m_too_many_peers); STAT_LOG(d, m_transport_timeout_peers); + STAT_LOG(d, sst.utp_stats.num_idle); + STAT_LOG(d, sst.utp_stats.num_syn_sent); + STAT_LOG(d, sst.utp_stats.num_connected); + STAT_LOG(d, sst.utp_stats.num_fin_sent); + STAT_LOG(d, sst.utp_stats.num_close_wait); + fprintf(m_stats_logger, "\n"); #undef STAT_LOG