forked from premiere/premiere-libtorrent
log more stats
This commit is contained in:
parent
1bd4d1633c
commit
ccf9c5a0fd
|
@ -965,6 +965,23 @@ namespace libtorrent
|
|||
int m_disconnected_peers;
|
||||
int m_eof_peers;
|
||||
int m_connreset_peers;
|
||||
int m_connrefused_peers;
|
||||
int m_connaborted_peers;
|
||||
int m_perm_peers;
|
||||
int m_buffer_peers;
|
||||
int m_unreachable_peers;
|
||||
int m_broken_pipe_peers;
|
||||
int m_addrinuse_peers;
|
||||
int m_no_access_peers;
|
||||
int m_invalid_arg_peers;
|
||||
int m_aborted_peers;
|
||||
|
||||
int m_error_incoming_peers;
|
||||
int m_error_outgoing_peers;
|
||||
int m_error_rc4_peers;
|
||||
int m_error_encrypted_peers;
|
||||
int m_error_tcp_peers;
|
||||
int m_error_utp_peers;
|
||||
// the number of times the piece picker fell through
|
||||
// to the end-game mode
|
||||
int m_end_game_piece_picker_blocks;
|
||||
|
|
|
@ -116,6 +116,8 @@ namespace libtorrent
|
|||
#ifndef TORRENT_DISABLE_ENCRYPTION
|
||||
bool supports_encryption() const
|
||||
{ return m_encrypted; }
|
||||
bool rc4_encrypted() const
|
||||
{ return m_rc4_encrypted; }
|
||||
#endif
|
||||
|
||||
virtual int type() const { return peer_connection::bittorrent_connection; }
|
||||
|
|
|
@ -125,14 +125,19 @@ def gen_html(reports, generations):
|
|||
|
||||
reports = [
|
||||
('torrents', 'num', '', 'number of torrents in different torrent states', ['downloading torrents', 'seeding torrents', 'checking torrents', 'stopped torrents', 'upload-only torrents', 'error torrents']),
|
||||
('peers', 'num', '', 'num connected peers', ['peers', 'connecting peers', 'connection attempts', 'banned peers', 'max connections']),
|
||||
('peers', 'num', '', 'num connected peers', ['peers', 'connecting peers', 'connection attempts', 'banned peers']),
|
||||
('peers_max', 'num', '', 'num connected peers', ['peers', 'connecting peers', 'connection attempts', 'banned peers', 'max connections']),
|
||||
('peer_churn', 'num', '', 'connecting and disconnecting peers', ['connecting peers', 'connection attempts', 'error peers']),
|
||||
('connect_candidates', 'num', '', 'number of peers we know of that we can connect to', ['connect candidates']),
|
||||
('peers_list_size', 'num', '', 'number of known peers (not necessarily connected)', ['num list peers']),
|
||||
('overall_rates', 'rate', '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']),
|
||||
('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','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', 'no memory peer errors', 'too many peers', 'transport timeout 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', 'no memory peer errors', 'too many peers', 'transport timeout peers', 'connection refused peers', 'connection aborted peers', 'permission denied peers', 'no buffer peers', 'host unreachable peers', 'broken pipe peers', 'address in use peers', 'access denied peers', 'invalid argument peers', 'operation aborted peers']),
|
||||
('peer_errors_incoming', 'num', '', 'number of peers by incoming or outgoing connection', ['error incoming peers', 'error outgoing peers']),
|
||||
('peer_errors_transport', 'num', '', 'number of peers by transport protocol', ['error tcp peers', 'error utp peers']),
|
||||
('peer_errors_encryption', 'num', '', 'number of peers by encryption level', ['error encrypted peers', 'error rc4 peers', 'error peers']),
|
||||
('waste', '% of all downloaded bytes', '%%', 'proportion of all downloaded bytes that were wasted', ['% failed payload bytes', '% wasted payload bytes', '% protocol bytes']),
|
||||
('waste by source', '% of all wasted bytes', '%%', 'what\' causing the waste', [ 'redundant timed-out', 'redundant cancelled', 'redundant unknown', 'redundant seed', 'redundant end-game', 'redundant closing']),
|
||||
('average_disk_time_absolute', 'job time', 's', 'running averages of timings of disk operations', ['disk read time', 'disk write time', 'disk hash time', 'disk job time', 'disk sort time']),
|
||||
|
@ -145,6 +150,7 @@ reports = [
|
|||
('disk_iops', 'operations/s', '', 'number of disk operations per second', ['read ops/s', 'write ops/s', 'smooth read ops/s', 'smooth write ops/s']),
|
||||
('disk pending reads', 'Bytes', '', 'number of bytes peers are waiting for to be read from the disk', ['pending reading bytes']),
|
||||
('mixed mode', 'rate', 'B/s', 'rates by transport protocol', ['TCP up rate','TCP down rate','uTP up rate','uTP down rate','TCP up limit','TCP down limit']),
|
||||
('connection_type', '', 'num', 'peers by transport protocol', ['utp peers','tcp peers']),
|
||||
('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),
|
||||
|
|
|
@ -3516,15 +3516,26 @@ namespace libtorrent
|
|||
++m_ses.m_disconnected_peers;
|
||||
if (error == 2) ++m_ses.m_error_peers;
|
||||
if (ec == error::connection_reset) ++m_ses.m_connreset_peers;
|
||||
if (ec == error::eof) ++m_ses.m_eof_peers;
|
||||
if (ec == error_code(errors::upload_upload_connection)
|
||||
else if (ec == error::eof) ++m_ses.m_eof_peers;
|
||||
else if (ec == error::connection_refused) ++m_ses.m_connrefused_peers;
|
||||
else if (ec == error::connection_aborted) ++m_ses.m_connaborted_peers;
|
||||
else if (ec == error::no_permission) ++m_ses.m_perm_peers;
|
||||
else if (ec == error::no_buffer_space) ++m_ses.m_buffer_peers;
|
||||
else if (ec == error::host_unreachable) ++m_ses.m_unreachable_peers;
|
||||
else if (ec == error::broken_pipe) ++m_ses.m_broken_pipe_peers;
|
||||
else if (ec == error::address_in_use) ++m_ses.m_addrinuse_peers;
|
||||
else if (ec == error::access_denied) ++m_ses.m_no_access_peers;
|
||||
else if (ec == error::invalid_argument) ++m_ses.m_invalid_arg_peers;
|
||||
else if (ec == error::operation_aborted) ++m_ses.m_aborted_peers;
|
||||
else if (ec == error_code(errors::upload_upload_connection)
|
||||
|| ec == error_code(errors::uninteresting_upload_peer)
|
||||
|| 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))
|
||||
if (ec == error_code(errors::timed_out)
|
||||
|| ec == error::timed_out)
|
||||
++m_ses.m_transport_timeout_peers;
|
||||
|
||||
if (ec == error_code(errors::timed_out_inactivity)
|
||||
|
@ -3540,6 +3551,22 @@ namespace libtorrent
|
|||
|
||||
if (ec == error_code(errors::timed_out_no_handshake))
|
||||
++m_ses.m_connect_timeouts;
|
||||
|
||||
if (m_socket->get<utp_stream>()) ++m_ses.m_error_utp_peers;
|
||||
else ++m_ses.m_error_tcp_peers;
|
||||
|
||||
if (m_outgoing) ++m_ses.m_error_outgoing_peers;
|
||||
else ++m_ses.m_error_incoming_peers;
|
||||
|
||||
|
||||
#ifndef TORRENT_DISABLE_ENCRYPTION
|
||||
if (type() == bittorrent_connection)
|
||||
{
|
||||
bt_peer_connection* bt = static_cast<bt_peer_connection*>(this);
|
||||
if (bt->supports_encryption()) ++m_ses.m_error_encrypted_peers;
|
||||
if (bt->rc4_encrypted() && bt->supports_encryption()) ++m_ses.m_error_rc4_peers;
|
||||
}
|
||||
#endif // TORRENT_DISABLE_ENCRYPTION
|
||||
#endif
|
||||
|
||||
// we cannot do this in a constructor
|
||||
|
|
|
@ -1207,6 +1207,27 @@ namespace aux {
|
|||
":uTP connected"
|
||||
":uTP fin-sent"
|
||||
":uTP close-wait"
|
||||
|
||||
":tcp peers"
|
||||
":utp peers"
|
||||
|
||||
":connection refused peers"
|
||||
":connection aborted peers"
|
||||
":permission denied peers"
|
||||
":no buffer peers"
|
||||
":host unreachable peers"
|
||||
":broken pipe peers"
|
||||
":address in use peers"
|
||||
":access denied peers"
|
||||
":invalid argument peers"
|
||||
":operation aborted peers"
|
||||
|
||||
":error incoming peers"
|
||||
":error outgoing peers"
|
||||
":error rc4 peers"
|
||||
":error encrypted peers"
|
||||
":error tcp peers"
|
||||
":error utp peers"
|
||||
"\n\n", m_stats_logger);
|
||||
}
|
||||
#endif
|
||||
|
@ -3492,10 +3513,34 @@ namespace aux {
|
|||
|
||||
void session_impl::reset_stat_counters()
|
||||
{
|
||||
m_error_peers = 0;
|
||||
// make these cumulative for easier reading of graphs
|
||||
/* m_error_peers = 0;
|
||||
m_disconnected_peers = 0;
|
||||
m_eof_peers = 0;
|
||||
m_connreset_peers = 0;
|
||||
m_connrefused_peers = 0;
|
||||
m_connaborted_peers = 0;
|
||||
m_perm_peers = 0;
|
||||
m_buffer_peers = 0;
|
||||
m_unreachable_peers = 0;
|
||||
m_broken_pipe_peers = 0;
|
||||
m_addrinuse_peers = 0;
|
||||
m_no_access_peers = 0;
|
||||
m_invalid_arg_peers = 0;
|
||||
m_aborted_peers = 0;
|
||||
m_error_incoming_peers = 0;
|
||||
m_error_outgoing_peers = 0;
|
||||
m_error_rc4_peers = 0;
|
||||
m_error_encrypted_peers = 0;
|
||||
m_error_tcp_peers = 0;
|
||||
m_error_utp_peers = 0;
|
||||
m_connect_timeouts = 0;
|
||||
m_uninteresting_peers = 0;
|
||||
m_transport_timeout_peers = 0;
|
||||
m_timeout_peers = 0;
|
||||
m_no_memory_peers = 0;
|
||||
m_too_many_peers = 0;
|
||||
*/
|
||||
m_end_game_piece_picker_blocks = 0;
|
||||
m_piece_picker_blocks = 0;
|
||||
m_piece_picks = 0;
|
||||
|
@ -3505,12 +3550,6 @@ namespace aux {
|
|||
m_incoming_piece_picks = 0;
|
||||
m_end_game_piece_picks = 0;
|
||||
m_snubbed_piece_picks = 0;
|
||||
m_connect_timeouts = 0;
|
||||
m_uninteresting_peers = 0;
|
||||
m_transport_timeout_peers = 0;
|
||||
m_timeout_peers = 0;
|
||||
m_no_memory_peers = 0;
|
||||
m_too_many_peers = 0;
|
||||
m_connection_attempts = 0;
|
||||
m_num_banned_peers = 0;
|
||||
m_banned_for_hash_failure = 0;
|
||||
|
@ -3591,6 +3630,8 @@ namespace aux {
|
|||
int utp_peak_recv_delay = 0;
|
||||
boost::uint64_t utp_send_delay_sum = 0;
|
||||
boost::uint64_t utp_recv_delay_sum = 0;
|
||||
int num_utp_peers = 0;
|
||||
int num_tcp_peers = 0;
|
||||
int utp_num_delay_sockets = 0;
|
||||
int utp_num_recv_delay_sockets = 0;
|
||||
int num_complete_connections = 0;
|
||||
|
@ -3662,11 +3703,13 @@ namespace aux {
|
|||
utp_recv_delay_sum += recv_delay;
|
||||
++utp_num_recv_delay_sockets;
|
||||
}
|
||||
++num_utp_peers;
|
||||
}
|
||||
else
|
||||
{
|
||||
tcp_up_rate += ul_rate;
|
||||
tcp_down_rate += dl_rate;
|
||||
++num_tcp_peers;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -3857,6 +3900,27 @@ namespace aux {
|
|||
STAT_LOG(d, sst.utp_stats.num_fin_sent);
|
||||
STAT_LOG(d, sst.utp_stats.num_close_wait);
|
||||
|
||||
STAT_LOG(d, num_tcp_peers);
|
||||
STAT_LOG(d, num_utp_peers);
|
||||
|
||||
STAT_LOG(d, m_connrefused_peers);
|
||||
STAT_LOG(d, m_connaborted_peers);
|
||||
STAT_LOG(d, m_perm_peers);
|
||||
STAT_LOG(d, m_buffer_peers);
|
||||
STAT_LOG(d, m_unreachable_peers);
|
||||
STAT_LOG(d, m_broken_pipe_peers);
|
||||
STAT_LOG(d, m_addrinuse_peers);
|
||||
STAT_LOG(d, m_no_access_peers);
|
||||
STAT_LOG(d, m_invalid_arg_peers);
|
||||
STAT_LOG(d, m_aborted_peers);
|
||||
|
||||
STAT_LOG(d, m_error_incoming_peers);
|
||||
STAT_LOG(d, m_error_outgoing_peers);
|
||||
STAT_LOG(d, m_error_rc4_peers);
|
||||
STAT_LOG(d, m_error_encrypted_peers);
|
||||
STAT_LOG(d, m_error_tcp_peers);
|
||||
STAT_LOG(d, m_error_utp_peers);
|
||||
|
||||
fprintf(m_stats_logger, "\n");
|
||||
|
||||
#undef STAT_LOG
|
||||
|
|
Loading…
Reference in New Issue