exposed queued disk bytes in peer_info

This commit is contained in:
Arvid Norberg 2007-08-01 06:11:11 +00:00
parent 786d4e5f25
commit 54aa76f940
3 changed files with 8 additions and 2 deletions

View File

@ -303,7 +303,7 @@ int peer_index(libtorrent::tcp::endpoint addr, std::vector<libtorrent::peer_info
void print_peer_info(std::ostream& out, std::vector<libtorrent::peer_info> const& peers)
{
using namespace libtorrent;
out << " down (total) up (total) que req flags source fail hshf sndb inactive wait block-progress "
out << " down (total) up (total) que req flags source fail hshf sndb inactive wait disk block-progress "
#ifndef TORRENT_DISABLE_RESOLVE_COUNTRIES
"country "
#endif
@ -347,7 +347,8 @@ void print_peer_info(std::ostream& out, std::vector<libtorrent::peer_info> const
<< to_string(i->num_hashfails, 4) << " "
<< to_string(i->send_buffer_size, 4) << " "
<< to_string(total_seconds(i->last_active), 8) << " "
<< to_string(total_seconds(i->last_request), 4) << " ";
<< to_string(total_seconds(i->last_request), 4) << " "
<< to_string(i->pending_disk_bytes, 4) << " ";
if (i->downloading_piece_index >= 0)
{

View File

@ -144,6 +144,10 @@ namespace libtorrent
// approximate peer download rate
int remote_dl_rate;
// number of bytes this peer has in
// the disk write queue
int pending_disk_bytes;
};
}

View File

@ -1652,6 +1652,7 @@ namespace libtorrent
p.payload_up_speed = statistics().upload_payload_rate();
p.pid = pid();
p.ip = remote();
p.pending_disk_bytes = m_outstanding_writing_bytes;
#ifndef TORRENT_DISABLE_RESOLVE_COUNTRIES
p.country[0] = m_country[0];