log number of peers in end-game mode

This commit is contained in:
Arvid Norberg 2011-06-13 16:20:21 +00:00
parent d6c8184381
commit a5c3554a87
2 changed files with 6 additions and 2 deletions

View File

@ -110,7 +110,7 @@ reports = [
('overall_rates', 'Bytes / second', 'B/s', 'download and upload rates', ['uploaded bytes', 'downloaded bytes', 'upload rate', 'download rate', 'smooth upload rate', 'smooth download rate']), ('overall_rates', 'Bytes / second', 'B/s', 'download and upload rates', ['uploaded bytes', 'downloaded bytes', 'upload rate', 'download rate', 'smooth upload rate', 'smooth download rate']),
('disk_write_queue', 'Bytes', 'B', 'bytes queued up by peers, to be written to disk', ['disk write queued bytes', 'disk queue limit', 'disk queue low watermark']), ('disk_write_queue', 'Bytes', 'B', 'bytes queued up by peers, to be written to disk', ['disk write queued bytes', 'disk queue limit', 'disk queue low watermark']),
('peers_upload', 'num', '', 'number of peers by state wrt. uploading', ['peers up interested', 'peers up unchoked', 'peers up requests', 'peers disk-up', 'peers bw-up', 'max unchoked']), ('peers_upload', 'num', '', 'number of peers by state wrt. uploading', ['peers up interested', 'peers up unchoked', 'peers up requests', 'peers disk-up', 'peers bw-up', 'max unchoked']),
('peers_download', 'num', '', 'number of peers by state wrt. downloading', ['peers down interesting', 'peers down unchoked', 'peers down requests', 'peers disk-down', 'peers bw-down']), ('peers_download', 'num', '', 'number of peers by state wrt. downloading', ['peers down interesting', 'peers down unchoked', 'peers down requests', 'peers disk-down', 'peers bw-down','num end-game peers']),
('peer_errors', 'num', '', 'number of peers by error that disconnected them', ['error peers', 'peer disconnects', 'peers eof', 'peers connection reset', 'connect timeouts', 'uninteresting peers disconnect', 'banned for hash failure']), ('peer_errors', 'num', '', 'number of peers by error that disconnected them', ['error peers', 'peer disconnects', 'peers eof', 'peers connection reset', 'connect timeouts', 'uninteresting peers disconnect', 'banned for hash failure']),
('waste', '% of all downloaded bytes', '%%', 'proportion of all downloaded bytes that were wasted', ['% failed payload bytes', '% wasted payload bytes', '% protocol bytes']), ('waste', '% of all downloaded bytes', '%%', 'proportion of all downloaded bytes that were wasted', ['% failed payload bytes', '% wasted payload bytes', '% protocol bytes']),
('average_disk_time_absolute', 'microseconds', 'us', 'running averages of timings of disk operations', ['disk read time', 'disk write time', 'disk queue time', 'disk hash time', 'disk job time', 'disk sort time']), ('average_disk_time_absolute', 'microseconds', 'us', 'running averages of timings of disk operations', ['disk read time', 'disk write time', 'disk queue time', 'disk hash time', 'disk job time', 'disk sort time']),

View File

@ -956,6 +956,7 @@ namespace aux {
":read job queue size limit" ":read job queue size limit"
":smooth upload rate" ":smooth upload rate"
":smooth download rate" ":smooth download rate"
":num end-game peers"
"\n\n", m_stats_logger); "\n\n", m_stats_logger);
} }
#endif #endif
@ -3144,6 +3145,7 @@ namespace aux {
int num_half_open = 0; int num_half_open = 0;
int peers_down_unchoked = 0; int peers_down_unchoked = 0;
int peers_up_unchoked = 0; int peers_up_unchoked = 0;
int num_end_game_peers = 0;
for (connection_map::iterator i = m_connections.begin() for (connection_map::iterator i = m_connections.begin()
, end(m_connections.end()); i != end; ++i) , end(m_connections.end()); i != end; ++i)
{ {
@ -3162,6 +3164,7 @@ namespace aux {
if (p->is_interesting()) ++peers_down_interesting; if (p->is_interesting()) ++peers_down_interesting;
if (p->send_buffer_size() > 100 || !p->upload_queue().empty()) if (p->send_buffer_size() > 100 || !p->upload_queue().empty())
++peers_up_requests; ++peers_up_requests;
if (p->endgame()) ++num_endgame_peers;
int dl_bucket = 0; int dl_bucket = 0;
int dl_rate = p->statistics().download_payload_rate(); int dl_rate = p->statistics().download_payload_rate();
@ -3211,7 +3214,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%f\t%f\t" "%d\t%d\t%d\t%d\t%d\t%d\t%d\t%d\t%f\t%f\t"
"%f\t%f\t%d\t%f\t%d\t%d\t%d\t%d\t%d\t%d\t" "%f\t%f\t%d\t%f\t%d\t%d\t%d\t%d\t%d\t%d\t"
"%d\n" "%d\t%d\n"
, total_milliseconds(now - m_last_log_rotation) / 1000.f , total_milliseconds(now - m_last_log_rotation) / 1000.f
, int(m_stat.total_upload() - m_last_uploaded) , int(m_stat.total_upload() - m_last_uploaded)
, int(m_stat.total_download() - m_last_downloaded) , int(m_stat.total_download() - m_last_downloaded)
@ -3313,6 +3316,7 @@ namespace aux {
, m_settings.unchoke_slots_limit * 2 , m_settings.unchoke_slots_limit * 2
, m_stat.low_pass_upload_rate() , m_stat.low_pass_upload_rate()
, m_stat.low_pass_download_rate() , m_stat.low_pass_download_rate()
, num_end_game_peers
); );
m_last_cache_status = cs; m_last_cache_status = cs;
m_last_failed = m_total_failed_bytes; m_last_failed = m_total_failed_bytes;