add more utp statistics and make the congestion controller less aggressive when the up-link is not saturated

This commit is contained in:
Arvid Norberg
2013-09-14 10:06:48 +00:00
parent 84fcc0baf0
commit 1aa47fc13e
5 changed files with 144 additions and 32 deletions

View File

@@ -72,6 +72,19 @@ namespace libtorrent
s.num_fin_sent = 0;
s.num_close_wait = 0;
s.packet_loss = m_counters[packet_loss];
s.timeout = m_counters[timeout];
s.packets_in = m_counters[packets_in];
s.packets_out = m_counters[packets_out];
s.fast_retransmit = m_counters[fast_retransmit];
s.packet_resend = m_counters[packet_resend];
s.samples_above_target = m_counters[samples_above_target];
s.samples_below_target = m_counters[samples_below_target];
s.payload_pkts_in = m_counters[payload_pkts_in];
s.payload_pkts_out = m_counters[payload_pkts_out];
s.invalid_pkts_in = m_counters[invalid_pkts_in];
s.redundant_pkts_in = m_counters[redundant_pkts_in];
for (socket_map_t::const_iterator i = m_utp_sockets.begin()
, end(m_utp_sockets.end()); i != end; ++i)
{
@@ -432,6 +445,13 @@ namespace libtorrent
m_sock_buf_size = size;
}
void utp_socket_manager::inc_stats_counter(int counter)
{
TORRENT_ASSERT(counter >= 0);
TORRENT_ASSERT(counter < num_counters);
++m_counters[counter];
}
utp_socket_impl* utp_socket_manager::new_utp_socket(utp_stream* str)
{
boost::uint16_t send_id = 0;