fix up some old logging defines and improve the log output for send buffer watermark and request queue length

This commit is contained in:
arvidn 2015-07-17 23:54:25 -04:00
parent 2439ec55c1
commit 6c7c0cd878
1 changed files with 24 additions and 18 deletions

View File

@ -4516,7 +4516,7 @@ namespace libtorrent
void peer_connection::max_out_request_queue(int s)
{
#ifdef TORRENT_VERBOSE_LOGGING
#ifndef TORRENT_DISABLE_LOGGING
peer_log(peer_log_alert::info, "MAX_OUT_QUEUE_SIZE", "%d -> %d"
, m_max_out_request_queue, s);
#endif
@ -4559,7 +4559,7 @@ namespace libtorrent
if (m_desired_queue_size < min_request_queue)
m_desired_queue_size = min_request_queue;
#ifdef TORRENT_VERBOSE_LOGGING
#ifndef TORRENT_DISABLE_LOGGING
peer_log(peer_log_alert::info, "UPDATE_QUEUE_SIZE"
, "dqs: %d max: %d dl: %d qt: %d snubbed: %d"
, m_desired_queue_size, m_max_out_request_queue
@ -4984,7 +4984,7 @@ namespace libtorrent
// only add new piece-chunks if the send buffer is small enough
// otherwise there will be no end to how large it will be!
boost::uint64_t upload_rate = int(m_statistics.upload_rate());
boost::uint64_t upload_rate = m_statistics.upload_rate();
int buffer_size_watermark = int(upload_rate
* m_settings.get_int(settings_pack::send_buffer_watermark_factor) / 100);
@ -4998,11 +4998,14 @@ namespace libtorrent
buffer_size_watermark = m_settings.get_int(settings_pack::send_buffer_watermark);
}
#ifdef TORRENT_VERBOSE_LOGGING
#ifndef TORRENT_DISABLE_LOGGING
peer_log(peer_log_alert::outgoing, "SEND_BUFFER_WATERMARK"
, "%d max: %d min: %d factor: %d"
, buffer_size_watermark, m_ses.settings().send_buffer_watermark
, m_ses.settings().send_buffer_low_watermark, m_ses.settings().send_buffer_watermark_factor);
, "current watermark: %d max: %d min: %d factor: %d upload-rate: %d B/s"
, buffer_size_watermark
, m_ses.settings().get_int(settings_pack::send_buffer_watermark)
, m_ses.settings().get_int(settings_pack::send_buffer_low_watermark)
, m_ses.settings().get_int(settings_pack::send_buffer_watermark_factor)
, int(upload_rate));
#endif
// don't just pop the front element here, since in seed mode one request may
@ -5472,15 +5475,18 @@ namespace libtorrent
if (m_send_buffer.empty())
{
peer_log(peer_log_alert::outgoing, "SEND_BUFFER_DEPLETED"
, "quota: %d buf: %d connecting: %s disconnecting: %s pending_disk: %d"
, "quota: %d buf: %d connecting: %s disconnecting: %s "
"pending_disk: %d piece-requests: %d"
, m_quota[upload_channel]
, int(m_send_buffer.size()), m_connecting?"yes":"no"
, m_disconnecting?"yes":"no", m_reading_bytes);
, m_disconnecting?"yes":"no", m_reading_bytes
, int(m_requests.size()));
}
else
{
peer_log(peer_log_alert::outgoing, "CANNOT_WRITE"
, "quota: %d buf: %d connecting: %s disconnecting: %s pending_disk: %d"
, "quota: %d buf: %d connecting: %s disconnecting: %s "
"pending_disk: %d"
, m_quota[upload_channel]
, int(m_send_buffer.size()), m_connecting?"yes":"no"
, m_disconnecting?"yes":"no", m_reading_bytes);