more disconnect granularity in stats logging

This commit is contained in:
Arvid Norberg 2011-02-14 05:38:59 +00:00
parent b471e40064
commit 247ad31dc0
4 changed files with 13 additions and 6 deletions

View File

@ -890,6 +890,7 @@ namespace libtorrent
int m_snubbed_piece_picks;
int m_connect_timeouts;
int m_uninteresting_peers;
int m_timeout_peers;
#endif
// each second tick the timer takes a little

View File

@ -55,7 +55,7 @@ gen_report('peer_ul_rates2', ['peers up 0-2', 'peers up 2-5', 'peers up 5-10', '
gen_report('disk', ['disk write queued bytes', 'disk block buffers'])
gen_report('peers_upload', ['peers up interested', 'peers up unchoked', 'peers up requests', 'peers disk-up', 'peers bw-up'])
gen_report('peers_download', ['peers down interesting', 'peers down unchoked', 'peers down requests', 'peers disk-down', 'peers bw-down'])
gen_report('peer_errors', ['error peers', 'peer disconnects', 'peers eof', 'peers connection reset' 'connect timeouts', 'uninteresting peers disconnect'])
gen_report('peer_errors', ['error peers', 'peer disconnects', 'peers eof', 'peers connection reset', 'connect timeouts', 'uninteresting peers disconnect'])
gen_report('piece_picker_end_game', ['end game piece picker blocks', 'strict end game piece picker blocks', 'piece picker blocks', 'piece picks', 'reject piece picks', 'unchoked piece picks', 'incoming redundant piece picks', 'incoming piece picks', 'end game piece picks', 'snubbed piece picks'])
gen_report('piece_picker', ['piece picks', 'reject piece picks', 'unchoked piece picks', 'incoming redundant piece picks', 'incoming piece picks', 'end game piece picks', 'snubbed piece picks'])
gen_report('bandwidth', ['% failed payload bytes', '% wasted payload bytes', '% protocol bytes'])

View File

@ -3350,14 +3350,16 @@ namespace libtorrent
if (ec == error::eof) ++m_ses.m_eof_peers;
if (ec == error_code(errors::upload_upload_connection)
|| ec == error_code(errors::uninteresting_upload_peer)
|| ec == error_code(errors::timed_out_inactivity)
|| ec == error_code(errors::timed_out_no_handshake)
|| ec == error_code(errors::timed_out_no_request)
|| ec == error_code(errors::timed_out_no_interest)
|| ec == error_code(errors::torrent_aborted)
|| ec == error_code(errors::self_connection)
|| ec == error_code(errors::torrent_paused))
++m_ses.m_uninteresting_peers;
if (ec == error_code(errors::timed_out_inactivity)
|| ec == error_code(errors::timed_out_no_handshake)
|| ec == error_code(errors::timed_out_no_request)
|| ec == error_code(errors::timed_out_no_interest))
++m_ses.m_timeout_peers;
#endif
// we cannot do this in a constructor

View File

@ -808,6 +808,7 @@ namespace aux {
m_snubbed_piece_picks = 0;
m_connect_timeouts = 0;
m_uninteresting_peers = 0;
m_timeout_peers = 0;
rotate_stats_log();
#endif
#ifdef TORRENT_DISK_STATS
@ -913,6 +914,7 @@ namespace aux {
":snubbed piece picks"
":connect timeouts"
":uninteresting peers disconnect"
":timeout peers"
":% failed payload bytes"
":% wasted payload bytes"
":% protocol bytes"
@ -2690,7 +2692,7 @@ namespace aux {
"%d\t%d\t%d\t%d\t%d\t%d\t%d\t%d\t%d\t%d\t"
"%d\t%d\t%d\t%d\t%d\t%d\t%d\t%d\t%d\t%d\t"
"%d\t%d\t%d\t%d\t%d\t%d\t%d\t%d\t%d\t%d\t"
"%d\t%d\t%d\t%d\t%d\t%d\t%d\t%d\t%d\t"
"%d\t%d\t%d\t%d\t%d\t%d\t%d\t%d\t%d\t%d\t"
"%f\t%f\t%f\n"
, total_milliseconds(now - m_last_log_rotation) / 1000.f
, int(upload_rate)
@ -2751,6 +2753,7 @@ namespace aux {
, m_snubbed_piece_picks
, m_connect_timeouts
, m_uninteresting_peers
, m_timeout_peers
, (float(m_total_failed_bytes) * 100.f / m_stat.total_payload_download())
, (float(m_total_redundant_bytes) * 100.f / m_stat.total_payload_download())
, (float(m_stat.total_protocol_download()) * 100.f / m_stat.total_download())
@ -2772,6 +2775,7 @@ namespace aux {
m_snubbed_piece_picks = 0;
m_connect_timeouts = 0;
m_uninteresting_peers = 0;
m_timeout_peers = 0;
#endif
// --------------------------------------------------------------