log uTP states to stats log

This commit is contained in:
Arvid Norberg 2012-01-17 03:11:16 +00:00
parent 74b745e876
commit 88012b6a1c
2 changed files with 13 additions and 0 deletions

View File

@ -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']),

View File

@ -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