add incoming requests to stats logging
This commit is contained in:
parent
4a1fa63d82
commit
8f3c3de1e2
|
@ -870,7 +870,8 @@ namespace libtorrent
|
||||||
bitfield m_have_piece;
|
bitfield m_have_piece;
|
||||||
|
|
||||||
// the queue of requests we have got
|
// the queue of requests we have got
|
||||||
// from this peer
|
// from this peer that haven't been issued
|
||||||
|
// to the disk thread yet
|
||||||
std::vector<peer_request> m_requests;
|
std::vector<peer_request> m_requests;
|
||||||
|
|
||||||
// the blocks we have reserved in the piece
|
// the blocks we have reserved in the piece
|
||||||
|
|
|
@ -138,6 +138,7 @@ reports = [
|
||||||
('peer_errors_incoming', 'num', '', 'number of peers by incoming or outgoing connection', ['error incoming peers', 'error outgoing 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_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']),
|
('peer_errors_encryption', 'num', '', 'number of peers by encryption level', ['error encrypted peers', 'error rc4 peers', 'error peers']),
|
||||||
|
('incoming requests', 'num', '', 'incoming 16kiB block requests', ['pending incoming block requests', 'average pending incoming block requests']),
|
||||||
('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']),
|
||||||
('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']),
|
('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']),
|
('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']),
|
||||||
|
|
|
@ -1260,6 +1260,8 @@ namespace aux {
|
||||||
":error utp peers"
|
":error utp peers"
|
||||||
|
|
||||||
":total peers"
|
":total peers"
|
||||||
|
":pending incoming block requests"
|
||||||
|
":average pending incoming block requests"
|
||||||
"\n\n", m_stats_logger);
|
"\n\n", m_stats_logger);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
@ -3647,6 +3649,7 @@ namespace aux {
|
||||||
int peers_up_unchoked = 0;
|
int peers_up_unchoked = 0;
|
||||||
int num_end_game_peers = 0;
|
int num_end_game_peers = 0;
|
||||||
int reading_bytes = 0;
|
int reading_bytes = 0;
|
||||||
|
int pending_incoming_reqs = 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)
|
||||||
{
|
{
|
||||||
|
@ -3668,6 +3671,8 @@ namespace aux {
|
||||||
if (p->endgame()) ++num_end_game_peers;
|
if (p->endgame()) ++num_end_game_peers;
|
||||||
reading_bytes += p->num_reading_bytes();
|
reading_bytes += p->num_reading_bytes();
|
||||||
|
|
||||||
|
pending_incoming_reqs += int(p->upload_queue().size());
|
||||||
|
|
||||||
int dl_bucket = 0;
|
int dl_bucket = 0;
|
||||||
int dl_rate = p->statistics().download_payload_rate();
|
int dl_rate = p->statistics().download_payload_rate();
|
||||||
if (dl_rate == 0) dl_bucket = 0;
|
if (dl_rate == 0) dl_bucket = 0;
|
||||||
|
@ -3929,6 +3934,8 @@ namespace aux {
|
||||||
STAT_LOG(d, m_error_utp_peers);
|
STAT_LOG(d, m_error_utp_peers);
|
||||||
|
|
||||||
STAT_LOG(d, int(m_connections.size()));
|
STAT_LOG(d, int(m_connections.size()));
|
||||||
|
STAT_LOG(d, pending_incoming_reqs);
|
||||||
|
STAT_LOG(f, num_complete_connections == 0 ? 0.f : (float(pending_incoming_reqs) / num_complete_connections));
|
||||||
|
|
||||||
fprintf(m_stats_logger, "\n");
|
fprintf(m_stats_logger, "\n");
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue