expose more info through peer_info

This commit is contained in:
Arvid Norberg
2008-01-10 22:13:23 +00:00
parent 9fca960d3c
commit 3a727e99ff
7 changed files with 72 additions and 28 deletions

View File

@@ -2242,6 +2242,14 @@ struct peer_info
int upload_limit;
int download_limit;
time_duration last_request;
time_duration last_active;
int send_buffer_size;
int used_send_buffer;
int num_hashfails;
char country[2];
size_type load_balancing;
@@ -2249,6 +2257,8 @@ struct peer_info
int download_queue_length;
int upload_queue_length;
int failcount;
int downloading_piece_index;
int downloading_block_index;
int downloading_progress;
@@ -2383,6 +2393,12 @@ peer every second. It may be -1 if there's no local limit on the peer. The globa
limit and the torrent limit is always enforced anyway.</p>
<p><tt class="docutils literal"><span class="pre">download_limit</span></tt> is the number of bytes per second this peer is allowed to
receive. -1 means it's unlimited.</p>
<p><tt class="docutils literal"><span class="pre">last_request</span></tt> and <tt class="docutils literal"><span class="pre">last_active</span></tt> is the time since we last sent a request
to this peer and since any transfer occurred with this peer, respectively.</p>
<p><tt class="docutils literal"><span class="pre">send_buffer_size</span></tt> and <tt class="docutils literal"><span class="pre">used_send_buffer</span></tt> is the number of bytes allocated
and used for the peer's send buffer, respectively.</p>
<p><tt class="docutils literal"><span class="pre">num_hashfails</span></tt> is the number of pieces this peer has participated in
sending us that turned out to fail the hash check.</p>
<p><tt class="docutils literal"><span class="pre">country</span></tt> is the two letter <a class="reference" href="http://www.iso.org/iso/en/prods-services/iso3166ma/02iso-3166-code-lists/list-en1.html">ISO 3166 country code</a> for the country the peer
is connected from. If the country hasn't been resolved yet, both chars are set
to 0. If the resolution failed for some reason, the field is set to &quot;--&quot;. If the
@@ -2398,6 +2414,9 @@ download.</p>
that hasn't been answered with a piece yet.</p>
<p><tt class="docutils literal"><span class="pre">upload_queue_length</span></tt> is the number of piece-requests we have received from this peer
that we haven't answered with a piece yet.</p>
<p><tt class="docutils literal"><span class="pre">failcount</span></tt> is the number of times this peer has &quot;failed&quot;. i.e. failed to connect
or disconnected us. The failcount is decremented when we see this peer in a tracker
response or peer exchange message.</p>
<p>You can know which piece, and which part of that piece, that is currently being
downloaded from a specific peer by looking at the next four members.
<tt class="docutils literal"><span class="pre">downloading_piece_index</span></tt> is the index of the piece that is currently being downloaded.

View File

@@ -2231,6 +2231,14 @@ It contains the following fields::
int upload_limit;
int download_limit;
time_duration last_request;
time_duration last_active;
int send_buffer_size;
int used_send_buffer;
int num_hashfails;
char country[2];
size_type load_balancing;
@@ -2238,6 +2246,8 @@ It contains the following fields::
int download_queue_length;
int upload_queue_length;
int failcount;
int downloading_piece_index;
int downloading_block_index;
int downloading_progress;
@@ -2357,6 +2367,15 @@ limit and the torrent limit is always enforced anyway.
``download_limit`` is the number of bytes per second this peer is allowed to
receive. -1 means it's unlimited.
``last_request`` and ``last_active`` is the time since we last sent a request
to this peer and since any transfer occurred with this peer, respectively.
``send_buffer_size`` and ``used_send_buffer`` is the number of bytes allocated
and used for the peer's send buffer, respectively.
``num_hashfails`` is the number of pieces this peer has participated in
sending us that turned out to fail the hash check.
``country`` is the two letter `ISO 3166 country code`__ for the country the peer
is connected from. If the country hasn't been resolved yet, both chars are set
to 0. If the resolution failed for some reason, the field is set to "--". If the
@@ -2378,6 +2397,10 @@ that hasn't been answered with a piece yet.
``upload_queue_length`` is the number of piece-requests we have received from this peer
that we haven't answered with a piece yet.
``failcount`` is the number of times this peer has "failed". i.e. failed to connect
or disconnected us. The failcount is decremented when we see this peer in a tracker
response or peer exchange message.
You can know which piece, and which part of that piece, that is currently being
downloaded from a specific peer by looking at the next four members.
``downloading_piece_index`` is the index of the piece that is currently being downloaded.