diff --git a/docs/manual.html b/docs/manual.html index 3adb105e8..7961af322 100644 --- a/docs/manual.html +++ b/docs/manual.html @@ -688,6 +688,9 @@ struct session_status size_type total_download; size_type total_upload; + size_type total_redundant_bytes; + size_type total_failed_bytes; + size_type total_payload_download; size_type total_payload_upload; @@ -710,6 +713,12 @@ versions is the payload download only.
total_download and total_upload are the total number of bytes downloaded and uploaded to and from all torrents. total_payload_download and total_payload_upload are the same thing but where only the payload is considered.
+total_redundant_bytes is the number of bytes that has been received more than once. +This can happen if a request from a peer times out and is requested from a different +peer, and then received again from the first one. To make this lower, increase the +request_timeout and the piece_timeout in the session settings.
+total_failed_bytes is the number of bytes that was downloaded which later failed +the hash-check.
num_peers is the total number of peer connections this session has. This includes
incoming connections that still hasn't sent their handshake or outgoing connections
that still hasn't completed the TCP connection. This number may be slightly higher
diff --git a/docs/manual.rst b/docs/manual.rst
index 9b8995e03..0943cc5f7 100644
--- a/docs/manual.rst
+++ b/docs/manual.rst
@@ -503,6 +503,9 @@ struct has the following members::
size_type total_download;
size_type total_upload;
+ size_type total_redundant_bytes;
+ size_type total_failed_bytes;
+
size_type total_payload_download;
size_type total_payload_upload;
@@ -528,6 +531,14 @@ versions is the payload download only.
uploaded to and from all torrents. ``total_payload_download`` and ``total_payload_upload``
are the same thing but where only the payload is considered.
+``total_redundant_bytes`` is the number of bytes that has been received more than once.
+This can happen if a request from a peer times out and is requested from a different
+peer, and then received again from the first one. To make this lower, increase the
+``request_timeout`` and the ``piece_timeout`` in the session settings.
+
+``total_failed_bytes`` is the number of bytes that was downloaded which later failed
+the hash-check.
+
``num_peers`` is the total number of peer connections this session has. This includes
incoming connections that still hasn't sent their handshake or outgoing connections
that still hasn't completed the TCP connection. This number may be slightly higher
diff --git a/examples/client_test.cpp b/examples/client_test.cpp
index e9fe80206..4269299e2 100644
--- a/examples/client_test.cpp
+++ b/examples/client_test.cpp
@@ -1319,7 +1319,9 @@ int main(int ac, char* av[])
<< " (" << esc("32") << add_suffix(sess_stat.total_download) << esc("0") << ") "
" up: " << esc("31") << add_suffix(sess_stat.upload_rate) << "/s " << esc("0")
<< " (" << esc("31") << add_suffix(sess_stat.total_upload) << esc("0") << ")"
- " unchoked: " << sess_stat.num_unchoked << " / " << sess_stat.allowed_upload_slots
+ " waste: " << add_suffix(sess_stat.total_redundant_bytes)
+ << " fail: " << add_suffix(sess_stat.total_failed_bytes)
+ << " unchoked: " << sess_stat.num_unchoked << " / " << sess_stat.allowed_upload_slots
<< " bw queues: (" << sess_stat.up_bandwidth_queue
<< " | " << sess_stat.down_bandwidth_queue << ") "
" write cache hits: " << ((cs.blocks_written - cs.writes) * 100 / cs.blocks_written) << "% "
diff --git a/include/libtorrent/aux_/session_impl.hpp b/include/libtorrent/aux_/session_impl.hpp
index 57da44b4a..e1345fab6 100644
--- a/include/libtorrent/aux_/session_impl.hpp
+++ b/include/libtorrent/aux_/session_impl.hpp
@@ -319,6 +319,18 @@ namespace libtorrent
int next_port();
+ void add_redundant_bytes(size_type b)
+ {
+ TORRENT_ASSERT(b > 0);
+ m_total_redundant_bytes += b;
+ }
+
+ void add_failed_bytes(size_type b)
+ {
+ TORRENT_ASSERT(b > 0);
+ m_total_failed_bytes += b;
+ }
+
// handles delayed alerts
alert_manager m_alerts;
@@ -608,6 +620,10 @@ namespace libtorrent
std::map