diff --git a/docs/gen_stats_doc.py b/docs/gen_stats_doc.py
new file mode 100644
index 000000000..cd11b7593
--- /dev/null
+++ b/docs/gen_stats_doc.py
@@ -0,0 +1,75 @@
+f = open('../src/session_stats.cpp')
+
+out = open('stats_counters.rst', 'w+')
+
+def print_field(str, width):
+ return '%s%s' % (str, ' ' * (width - len(str)))
+
+def render_section(names, description, types):
+ max_name_len = max(len(max(names, key=len)), len('name'))
+ max_type_len = max(len(max(types, key=len)), len('type'))
+
+ if description == '':
+ for n in names:
+ print 'WARNING: no description for "%s"' % n
+
+ # add link targets for the rest of the manual to reference
+ for n in names:
+ print >>out, '.. _%s:\n' % n
+
+ if len(names) > 0:
+ print >>out, '.. raw:: html\n'
+ for n in names:
+ print >>out, '\t' % n
+ print >>out, ''
+
+ separator = '+-' + ('-' * max_name_len) + '-+-' + ('-' * max_type_len) + '-+'
+
+ # build a table for the settings, their type and default value
+ print >>out, separator
+ print >>out, '| %s | %s |' % (print_field('name', max_name_len), print_field('type', max_type_len))
+ print >>out, separator.replace('-', '=')
+ for i in range(len(names)):
+ print >>out, '| %s | %s |' % (print_field(names[i], max_name_len), print_field(types[i], max_type_len))
+ print >>out, separator
+ print >>out
+ print >>out, description
+ print >>out, ''
+
+mode = ''
+
+description = ''
+names = []
+types = []
+
+for l in f:
+ l = l.strip()
+
+ if l.startswith('// '):
+ if len(names) > 0:
+ render_section(names, description, types)
+ description = ''
+ names = []
+ types = []
+
+ description += '\n' + l[3:]
+
+ if '#define' in l: continue
+
+ if 'METRIC(' in l:
+ args = l.split('(')[1].split(')')[0].split(',')
+
+ # args: category, name, type
+
+ names.append(args[0].strip() + '.' + args[1].strip())
+
+ # strip type_ prefix of type_gauge and type_counter
+ args[2] = args[2].strip()[5:]
+ types.append(args[2])
+
+if len(names) > 0:
+ render_section(names, decsription, types)
+
+out.close()
+f.close()
+
diff --git a/docs/makefile b/docs/makefile
index 29132a2c4..f1bc86bc7 100644
--- a/docs/makefile
+++ b/docs/makefile
@@ -55,10 +55,10 @@ all: html
settings.rst: ../include/libtorrent/settings_pack.hpp
python gen_settings_doc.py
-#stats_counters.rst: ../src/session_stats.cpp
-# python gen_stats_doc.py
+stats_counters.rst: ../src/session_stats.cpp
+ python gen_stats_doc.py
-manual.rst: settings.rst stats_counters.rst
+manual.rst: stats_counters.rst
touch manual.rst
troubleshooting_thumb.png: troubleshooting.png
@@ -70,7 +70,7 @@ troubleshooting.png: troubleshooting.dot
todo.html:gen_todo.py ../src/*.cpp ../include/libtorrent/*.hpp
python gen_todo.py
-$(REFERENCE_TARGETS:=.rst):gen_reference_doc.py ../include/libtorrent/*.hpp ../include/libtorrent/kademlia/*.hpp manual.rst settings.rst
+$(REFERENCE_TARGETS:=.rst):gen_reference_doc.py ../include/libtorrent/*.hpp ../include/libtorrent/kademlia/*.hpp manual.rst settings.rst session_stats.rst
python gen_reference_doc.py
%.epub:%.rst
diff --git a/docs/stats_counters.rst b/docs/stats_counters.rst
index 28520bf2e..6597178ec 100644
--- a/docs/stats_counters.rst
+++ b/docs/stats_counters.rst
@@ -2,6 +2,11 @@
.. _peer.disconnected_peers:
+.. raw:: html
+
+
+
+
+-------------------------+---------+
| name | type |
+=========================+=========+
@@ -10,6 +15,7 @@
| peer.disconnected_peers | counter |
+-------------------------+---------+
+
``error_peers`` is the total number of peer disconnects
caused by an error (not initiated by this client) and
disconnected initiated by this client (``disconnected_peers``).
@@ -38,6 +44,21 @@ disconnected initiated by this client (``disconnected_peers``).
.. _peer.aborted_peers:
+.. raw:: html
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+------------------------+---------+
| name | type |
+========================+=========+
@@ -66,6 +87,7 @@ disconnected initiated by this client (``disconnected_peers``).
| peer.aborted_peers | counter |
+------------------------+---------+
+
these counters break down the peer errors into more specific
categories. These errors are what the underlying transport
reported (i.e. TCP or uTP)
@@ -74,6 +96,11 @@ reported (i.e. TCP or uTP)
.. _peer.error_outgoing_peers:
+.. raw:: html
+
+
+
+
+---------------------------+---------+
| name | type |
+===========================+=========+
@@ -82,6 +109,7 @@ reported (i.e. TCP or uTP)
| peer.error_outgoing_peers | counter |
+---------------------------+---------+
+
these counters break down the peer errors into
whether they happen on incoming or outgoing peers.
@@ -89,6 +117,11 @@ whether they happen on incoming or outgoing peers.
.. _peer.error_encrypted_peers:
+.. raw:: html
+
+
+
+
+----------------------------+---------+
| name | type |
+============================+=========+
@@ -97,6 +130,7 @@ whether they happen on incoming or outgoing peers.
| peer.error_encrypted_peers | counter |
+----------------------------+---------+
+
these counters break down the peer errors into
whether they happen on encrypted peers (just
encrypted handshake) and rc4 peers (full stream
@@ -107,6 +141,11 @@ peers are more or less likely to fail
.. _peer.error_utp_peers:
+.. raw:: html
+
+
+
+
+----------------------+---------+
| name | type |
+======================+=========+
@@ -115,6 +154,7 @@ peers are more or less likely to fail
| peer.error_utp_peers | counter |
+----------------------+---------+
+
these counters break down the peer errors into
whether they happen on uTP peers or TCP peers.
these may indicate whether one protocol is
@@ -134,31 +174,54 @@ more error prone
.. _peer.num_banned_peers:
-.. _peer.connection_attempts:
-
.. _peer.banned_for_hash_failure:
-+------------------------------+---------+
-| name | type |
-+==============================+=========+
-| peer.connect_timeouts | counter |
-+------------------------------+---------+
-| peer.uninteresting_peers | counter |
-+------------------------------+---------+
-| peer.timeout_peers | counter |
-+------------------------------+---------+
-| peer.no_memory_peers | counter |
-+------------------------------+---------+
-| peer.too_many_peers | counter |
-+------------------------------+---------+
-| peer.transport_timeout_peers | counter |
-+------------------------------+---------+
-| peer.num_banned_peers | counter |
-+------------------------------+---------+
-| peer.connection_attempts | counter |
-+------------------------------+---------+
-| peer.banned_for_hash_failure | counter |
-+------------------------------+---------+
+.. _peer.connection_attempts:
+
+.. _peer.connection_attempt_loops:
+
+.. _peer.incoming_connections:
+
+.. raw:: html
+
+
+
+
+
+
+
+
+
+
+
+
+
++-------------------------------+---------+
+| name | type |
++===============================+=========+
+| peer.connect_timeouts | counter |
++-------------------------------+---------+
+| peer.uninteresting_peers | counter |
++-------------------------------+---------+
+| peer.timeout_peers | counter |
++-------------------------------+---------+
+| peer.no_memory_peers | counter |
++-------------------------------+---------+
+| peer.too_many_peers | counter |
++-------------------------------+---------+
+| peer.transport_timeout_peers | counter |
++-------------------------------+---------+
+| peer.num_banned_peers | counter |
++-------------------------------+---------+
+| peer.banned_for_hash_failure | counter |
++-------------------------------+---------+
+| peer.connection_attempts | counter |
++-------------------------------+---------+
+| peer.connection_attempt_loops | counter |
++-------------------------------+---------+
+| peer.incoming_connections | counter |
++-------------------------------+---------+
+
these counters break down the reasons to
disconnect peers.
@@ -181,27 +244,95 @@ disconnect peers.
.. _peer.num_ssl_utp_peers:
-+-------------------------------+-------+
-| name | type |
-+===============================+=======+
-| peer.num_tcp_peers | gauge |
-+-------------------------------+-------+
-| peer.num_socks5_peers | gauge |
-+-------------------------------+-------+
-| peer.num_http_proxy_peers | gauge |
-+-------------------------------+-------+
-| peer.num_utp_peers | gauge |
-+-------------------------------+-------+
-| peer.num_i2p_peers | gauge |
-+-------------------------------+-------+
-| peer.num_ssl_peers | gauge |
-+-------------------------------+-------+
-| peer.num_ssl_socks5_peers | gauge |
-+-------------------------------+-------+
-| peer.num_ssl_http_proxy_peers | gauge |
-+-------------------------------+-------+
-| peer.num_ssl_utp_peers | gauge |
-+-------------------------------+-------+
+.. _peer.num_peers_half_open:
+
+.. _peer.num_peers_connected:
+
+.. _peer.num_peers_up_interested:
+
+.. _peer.num_peers_down_interested:
+
+.. _peer.num_peers_up_unchoked:
+
+.. _peer.num_peers_down_unchoked:
+
+.. _peer.num_peers_up_requests:
+
+.. _peer.num_peers_down_requests:
+
+.. _peer.num_peers_end_game:
+
+.. _peer.num_peers_up_disk:
+
+.. _peer.num_peers_down_disk:
+
+.. raw:: html
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
++--------------------------------+-------+
+| name | type |
++================================+=======+
+| peer.num_tcp_peers | gauge |
++--------------------------------+-------+
+| peer.num_socks5_peers | gauge |
++--------------------------------+-------+
+| peer.num_http_proxy_peers | gauge |
++--------------------------------+-------+
+| peer.num_utp_peers | gauge |
++--------------------------------+-------+
+| peer.num_i2p_peers | gauge |
++--------------------------------+-------+
+| peer.num_ssl_peers | gauge |
++--------------------------------+-------+
+| peer.num_ssl_socks5_peers | gauge |
++--------------------------------+-------+
+| peer.num_ssl_http_proxy_peers | gauge |
++--------------------------------+-------+
+| peer.num_ssl_utp_peers | gauge |
++--------------------------------+-------+
+| peer.num_peers_half_open | gauge |
++--------------------------------+-------+
+| peer.num_peers_connected | gauge |
++--------------------------------+-------+
+| peer.num_peers_up_interested | gauge |
++--------------------------------+-------+
+| peer.num_peers_down_interested | gauge |
++--------------------------------+-------+
+| peer.num_peers_up_unchoked | gauge |
++--------------------------------+-------+
+| peer.num_peers_down_unchoked | gauge |
++--------------------------------+-------+
+| peer.num_peers_up_requests | gauge |
++--------------------------------+-------+
+| peer.num_peers_down_requests | gauge |
++--------------------------------+-------+
+| peer.num_peers_end_game | gauge |
++--------------------------------+-------+
+| peer.num_peers_up_disk | gauge |
++--------------------------------+-------+
+| peer.num_peers_down_disk | gauge |
++--------------------------------+-------+
+
the number of peer connections for each kind of socket.
these counts include half-open (connecting) peers.
@@ -222,6 +353,17 @@ these counts include half-open (connecting) peers.
.. _net.on_disk_counter:
+.. raw:: html
+
+
+
+
+
+
+
+
+
+
+-------------------------+---------+
| name | type |
+=========================+=========+
@@ -242,6 +384,7 @@ these counts include half-open (connecting) peers.
| net.on_disk_counter | counter |
+-------------------------+---------+
+
These counters count the number of times the
network thread wakes up for each respective
reason. If these counters are very large, it
@@ -251,6 +394,148 @@ mitigate it by increasing buffers and limits
for the specific trigger that wakes up the
thread.
+.. _net.sent_payload_bytes:
+
+.. _net.sent_bytes:
+
+.. _net.sent_ip_overhead_bytes:
+
+.. _net.sent_tracker_bytes:
+
+.. _net.recv_payload_bytes:
+
+.. _net.recv_bytes:
+
+.. _net.recv_ip_overhead_bytes:
+
+.. _net.recv_tracker_bytes:
+
+.. raw:: html
+
+
+
+
+
+
+
+
+
+
++----------------------------+---------+
+| name | type |
++============================+=========+
+| net.sent_payload_bytes | counter |
++----------------------------+---------+
+| net.sent_bytes | counter |
++----------------------------+---------+
+| net.sent_ip_overhead_bytes | counter |
++----------------------------+---------+
+| net.sent_tracker_bytes | counter |
++----------------------------+---------+
+| net.recv_payload_bytes | counter |
++----------------------------+---------+
+| net.recv_bytes | counter |
++----------------------------+---------+
+| net.recv_ip_overhead_bytes | counter |
++----------------------------+---------+
+| net.recv_tracker_bytes | counter |
++----------------------------+---------+
+
+
+total number of bytes sent and received by the session
+
+.. _net.limiter_up_queue:
+
+.. _net.limiter_down_queue:
+
+.. raw:: html
+
+
+
+
++------------------------+-------+
+| name | type |
++========================+=======+
+| net.limiter_up_queue | gauge |
++------------------------+-------+
+| net.limiter_down_queue | gauge |
++------------------------+-------+
+
+
+the number of sockets currently waiting for upload and download
+bandwidht from the rate limiter.
+
+.. _net.limiter_up_bytes:
+
+.. _net.limiter_down_bytes:
+
+.. raw:: html
+
+
+
+
++------------------------+-------+
+| name | type |
++========================+=======+
+| net.limiter_up_bytes | gauge |
++------------------------+-------+
+| net.limiter_down_bytes | gauge |
++------------------------+-------+
+
+
+the number of upload and download bytes waiting to be handed out from
+the rate limiter.
+
+.. _net.recv_failed_bytes:
+
+.. raw:: html
+
+
+
++-----------------------+---------+
+| name | type |
++=======================+=========+
+| net.recv_failed_bytes | counter |
++-----------------------+---------+
+
+
+the number of bytes downloaded that had to be discarded because they
+failed the hash check
+
+.. _net.recv_redundant_bytes:
+
+.. raw:: html
+
+
+
++--------------------------+---------+
+| name | type |
++==========================+=========+
+| net.recv_redundant_bytes | counter |
++--------------------------+---------+
+
+
+the number of downloaded bytes that were discarded because they
+were downloaded multiple times (from different peers)
+
+.. _net.has_incoming_connections:
+
+.. raw:: html
+
+
+
++------------------------------+-------+
+| name | type |
++==============================+=======+
+| net.has_incoming_connections | gauge |
++------------------------------+-------+
+
+
+is false by default and set to true when
+the first incoming connection is established
+this is used to know if the client is behind
+NAT or not.
+
.. _ses.num_checking_torrents:
.. _ses.num_stopped_torrents:
@@ -267,6 +552,17 @@ thread.
.. _ses.num_error_torrents:
+.. raw:: html
+
+
+
+
+
+
+
+
+
+
+----------------------------------+-------+
| name | type |
+==================================+=======+
@@ -287,6 +583,7 @@ thread.
| ses.num_error_torrents | gauge |
+----------------------------------+-------+
+
these gauges count the number of torrents in
different states. Each torrent only belongs to
one of these states. For torrents that could
@@ -295,42 +592,344 @@ in picked. For instance, a torrent with an error
counts as an error-torrent, regardless of its other
state.
+.. _ses.num_loaded_torrents:
+
+.. _ses.num_pinned_torrents:
+
+.. raw:: html
+
+
+
+
++-------------------------+-------+
+| name | type |
++=========================+=======+
+| ses.num_loaded_torrents | gauge |
++-------------------------+-------+
+| ses.num_pinned_torrents | gauge |
++-------------------------+-------+
+
+
+the number of torrents that are currently loaded
+
+.. _ses.num_piece_passed:
+
+.. _ses.num_piece_failed:
+
+.. _ses.num_have_pieces:
+
+.. _ses.num_total_pieces_added:
+
+.. raw:: html
+
+
+
+
+
+
++----------------------------+---------+
+| name | type |
++============================+=========+
+| ses.num_piece_passed | counter |
++----------------------------+---------+
+| ses.num_piece_failed | counter |
++----------------------------+---------+
+| ses.num_have_pieces | counter |
++----------------------------+---------+
+| ses.num_total_pieces_added | counter |
++----------------------------+---------+
+
+
+these count the number of times a piece has passed the
+hash check, the number of times a piece was successfully
+written to disk and the number of total possible pieces
+added by adding torrents. e.g. when adding a torrent with
+1000 piece, num_total_pieces_added is incremented by 1000.
+
.. _ses.torrent_evicted_counter:
+.. raw:: html
+
+
+
+-----------------------------+---------+
| name | type |
+=============================+=========+
| ses.torrent_evicted_counter | counter |
+-----------------------------+---------+
+
this counts the number of times a torrent has been
evicted (only applies when `dynamic loading of torrent files`_
is enabled).
-.. _picker.piece_picks:
+.. _ses.num_unchoke_slots:
-+--------------------+---------+
-| name | type |
-+====================+=========+
-| picker.piece_picks | counter |
-+--------------------+---------+
+.. raw:: html
-counts the number of times the piece picker has been invoked
+
-.. _picker.piece_picker_loops:
++-----------------------+-------+
+| name | type |
++=======================+=======+
+| ses.num_unchoke_slots | gauge |
++-----------------------+-------+
+
+
+the number of allowed unchoked peers
+
+.. _ses.num_incoming_choke:
+
+.. _ses.num_incoming_unchoke:
+
+.. _ses.num_incoming_interested:
+
+.. _ses.num_incoming_not_interested:
+
+.. _ses.num_incoming_have:
+
+.. _ses.num_incoming_bitfield:
+
+.. _ses.num_incoming_request:
+
+.. _ses.num_incoming_piece:
+
+.. _ses.num_incoming_cancel:
+
+.. _ses.num_incoming_dht_port:
+
+.. _ses.num_incoming_suggest:
+
+.. _ses.num_incoming_have_all:
+
+.. _ses.num_incoming_have_none:
+
+.. _ses.num_incoming_reject:
+
+.. _ses.num_incoming_allowed_fast:
+
+.. _ses.num_incoming_ext_handshake:
+
+.. _ses.num_incoming_pex:
+
+.. _ses.num_incoming_metadata:
+
+.. _ses.num_incoming_extended:
+
+.. _ses.num_outgoing_choke:
+
+.. _ses.num_outgoing_unchoke:
+
+.. _ses.num_outgoing_interested:
+
+.. _ses.num_outgoing_not_interested:
+
+.. _ses.num_outgoing_have:
+
+.. _ses.num_outgoing_bitfield:
+
+.. _ses.num_outgoing_request:
+
+.. _ses.num_outgoing_piece:
+
+.. _ses.num_outgoing_cancel:
+
+.. _ses.num_outgoing_dht_port:
+
+.. _ses.num_outgoing_suggest:
+
+.. _ses.num_outgoing_have_all:
+
+.. _ses.num_outgoing_have_none:
+
+.. _ses.num_outgoing_reject:
+
+.. _ses.num_outgoing_allowed_fast:
+
+.. _ses.num_outgoing_ext_handshake:
+
+.. _ses.num_outgoing_pex:
+
+.. _ses.num_outgoing_metadata:
+
+.. _ses.num_outgoing_extended:
+
+.. raw:: html
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
++---------------------------------+---------+
+| name | type |
++=================================+=========+
+| ses.num_incoming_choke | counter |
++---------------------------------+---------+
+| ses.num_incoming_unchoke | counter |
++---------------------------------+---------+
+| ses.num_incoming_interested | counter |
++---------------------------------+---------+
+| ses.num_incoming_not_interested | counter |
++---------------------------------+---------+
+| ses.num_incoming_have | counter |
++---------------------------------+---------+
+| ses.num_incoming_bitfield | counter |
++---------------------------------+---------+
+| ses.num_incoming_request | counter |
++---------------------------------+---------+
+| ses.num_incoming_piece | counter |
++---------------------------------+---------+
+| ses.num_incoming_cancel | counter |
++---------------------------------+---------+
+| ses.num_incoming_dht_port | counter |
++---------------------------------+---------+
+| ses.num_incoming_suggest | counter |
++---------------------------------+---------+
+| ses.num_incoming_have_all | counter |
++---------------------------------+---------+
+| ses.num_incoming_have_none | counter |
++---------------------------------+---------+
+| ses.num_incoming_reject | counter |
++---------------------------------+---------+
+| ses.num_incoming_allowed_fast | counter |
++---------------------------------+---------+
+| ses.num_incoming_ext_handshake | counter |
++---------------------------------+---------+
+| ses.num_incoming_pex | counter |
++---------------------------------+---------+
+| ses.num_incoming_metadata | counter |
++---------------------------------+---------+
+| ses.num_incoming_extended | counter |
++---------------------------------+---------+
+| ses.num_outgoing_choke | counter |
++---------------------------------+---------+
+| ses.num_outgoing_unchoke | counter |
++---------------------------------+---------+
+| ses.num_outgoing_interested | counter |
++---------------------------------+---------+
+| ses.num_outgoing_not_interested | counter |
++---------------------------------+---------+
+| ses.num_outgoing_have | counter |
++---------------------------------+---------+
+| ses.num_outgoing_bitfield | counter |
++---------------------------------+---------+
+| ses.num_outgoing_request | counter |
++---------------------------------+---------+
+| ses.num_outgoing_piece | counter |
++---------------------------------+---------+
+| ses.num_outgoing_cancel | counter |
++---------------------------------+---------+
+| ses.num_outgoing_dht_port | counter |
++---------------------------------+---------+
+| ses.num_outgoing_suggest | counter |
++---------------------------------+---------+
+| ses.num_outgoing_have_all | counter |
++---------------------------------+---------+
+| ses.num_outgoing_have_none | counter |
++---------------------------------+---------+
+| ses.num_outgoing_reject | counter |
++---------------------------------+---------+
+| ses.num_outgoing_allowed_fast | counter |
++---------------------------------+---------+
+| ses.num_outgoing_ext_handshake | counter |
++---------------------------------+---------+
+| ses.num_outgoing_pex | counter |
++---------------------------------+---------+
+| ses.num_outgoing_metadata | counter |
++---------------------------------+---------+
+| ses.num_outgoing_extended | counter |
++---------------------------------+---------+
+
+
+bittorrent message counters. These counters are incremented
+every time a message of the corresponding type is received from
+or sent to a bittorrent peer.
+
+.. _picker.piece_picker_partial_loops:
+
+.. _picker.piece_picker_suggest_loops:
+
+.. _picker.piece_picker_sequential_loops:
+
+.. _picker.piece_picker_reverse_rare_loops:
+
+.. _picker.piece_picker_rare_loops:
+
+.. _picker.piece_picker_rand_start_loops:
+
+.. _picker.piece_picker_rand_loops:
+
+.. _picker.piece_picker_busy_loops:
+
+.. raw:: html
+
+
+
+
+
+
+
+
+
+
++----------------------------------------+---------+
+| name | type |
++========================================+=========+
+| picker.piece_picker_partial_loops | counter |
++----------------------------------------+---------+
+| picker.piece_picker_suggest_loops | counter |
++----------------------------------------+---------+
+| picker.piece_picker_sequential_loops | counter |
++----------------------------------------+---------+
+| picker.piece_picker_reverse_rare_loops | counter |
++----------------------------------------+---------+
+| picker.piece_picker_rare_loops | counter |
++----------------------------------------+---------+
+| picker.piece_picker_rand_start_loops | counter |
++----------------------------------------+---------+
+| picker.piece_picker_rand_loops | counter |
++----------------------------------------+---------+
+| picker.piece_picker_busy_loops | counter |
++----------------------------------------+---------+
-+---------------------------+---------+
-| name | type |
-+===========================+=========+
-| picker.piece_picker_loops | counter |
-+---------------------------+---------+
the number of pieces considered while picking pieces
-.. _picker.end_game_piece_picker_blocks:
-
-.. _picker.piece_picker_blocks:
-
.. _picker.reject_piece_picks:
.. _picker.unchoke_piece_picks:
@@ -343,13 +942,57 @@ the number of pieces considered while picking pieces
.. _picker.snubbed_piece_picks:
+.. _picker.interesting_piece_picks:
+
+.. _picker.hash_fail_piece_picks:
+
+.. _disk.write_cache_blocks:
+
+.. _disk.read_cache_blocks:
+
+.. _disk.pinned_blocks:
+
+.. _disk.disk_blocks_in_use:
+
+.. _disk.queued_disk_jobs:
+
+.. _disk.num_read_jobs:
+
+.. _disk.num_write_jobs:
+
+.. _disk.num_jobs:
+
+.. _disk.num_writing_threads:
+
+.. _disk.num_running_threads:
+
+.. _disk.blocked_disk_jobs:
+
+.. raw:: html
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+---------------------------------------+---------+
| name | type |
+=======================================+=========+
-| picker.end_game_piece_picker_blocks | counter |
-+---------------------------------------+---------+
-| picker.piece_picker_blocks | counter |
-+---------------------------------------+---------+
| picker.reject_piece_picks | counter |
+---------------------------------------+---------+
| picker.unchoke_piece_picks | counter |
@@ -362,7 +1005,640 @@ the number of pieces considered while picking pieces
+---------------------------------------+---------+
| picker.snubbed_piece_picks | counter |
+---------------------------------------+---------+
+| picker.interesting_piece_picks | counter |
++---------------------------------------+---------+
+| picker.hash_fail_piece_picks | counter |
++---------------------------------------+---------+
+| disk.write_cache_blocks | gauge |
++---------------------------------------+---------+
+| disk.read_cache_blocks | gauge |
++---------------------------------------+---------+
+| disk.pinned_blocks | gauge |
++---------------------------------------+---------+
+| disk.disk_blocks_in_use | gauge |
++---------------------------------------+---------+
+| disk.queued_disk_jobs | gauge |
++---------------------------------------+---------+
+| disk.num_read_jobs | gauge |
++---------------------------------------+---------+
+| disk.num_write_jobs | gauge |
++---------------------------------------+---------+
+| disk.num_jobs | gauge |
++---------------------------------------+---------+
+| disk.num_writing_threads | gauge |
++---------------------------------------+---------+
+| disk.num_running_threads | gauge |
++---------------------------------------+---------+
+| disk.blocked_disk_jobs | gauge |
++---------------------------------------+---------+
+
This breaks down the piece picks into the event that
triggered it
+.. _disk.queued_write_bytes:
+
+.. _disk.arc_mru_size:
+
+.. _disk.arc_mru_ghost_size:
+
+.. _disk.arc_mfu_size:
+
+.. _disk.arc_mfu_ghost_size:
+
+.. _disk.arc_write_size:
+
+.. _disk.arc_volatile_size:
+
+.. _disk.num_blocks_written:
+
+.. _disk.num_blocks_read:
+
+.. _disk.num_blocks_cache_hits:
+
+.. _disk.num_write_ops:
+
+.. _disk.num_read_ops:
+
+.. raw:: html
+
+
+
+
+
+
+
+
+
+
+
+
+
+
++----------------------------+---------+
+| name | type |
++============================+=========+
+| disk.queued_write_bytes | gauge |
++----------------------------+---------+
+| disk.arc_mru_size | gauge |
++----------------------------+---------+
+| disk.arc_mru_ghost_size | gauge |
++----------------------------+---------+
+| disk.arc_mfu_size | gauge |
++----------------------------+---------+
+| disk.arc_mfu_ghost_size | gauge |
++----------------------------+---------+
+| disk.arc_write_size | gauge |
++----------------------------+---------+
+| disk.arc_volatile_size | gauge |
++----------------------------+---------+
+| disk.num_blocks_written | counter |
++----------------------------+---------+
+| disk.num_blocks_read | counter |
++----------------------------+---------+
+| disk.num_blocks_cache_hits | counter |
++----------------------------+---------+
+| disk.num_write_ops | counter |
++----------------------------+---------+
+| disk.num_read_ops | counter |
++----------------------------+---------+
+
+
+the number of bytes we have sent to the disk I/O
+thread for writing. Every time we hear back from
+the disk I/O thread with a completed write job, this
+is updated to the number of bytes the disk I/O thread
+is actually waiting for to be written (as opposed to
+bytes just hanging out in the cache)
+
+.. _disk.disk_read_time:
+
+.. _disk.disk_write_time:
+
+.. _disk.disk_hash_time:
+
+.. _disk.disk_job_time:
+
+.. raw:: html
+
+
+
+
+
+
++----------------------+---------+
+| name | type |
++======================+=========+
+| disk.disk_read_time | counter |
++----------------------+---------+
+| disk.disk_write_time | counter |
++----------------------+---------+
+| disk.disk_hash_time | counter |
++----------------------+---------+
+| disk.disk_job_time | counter |
++----------------------+---------+
+
+
+cumulative time spent in various disk jobs, as well
+as total for all disk jobs. Measured in microseconds
+
+.. _dht.dht_nodes:
+
+.. raw:: html
+
+
+
++---------------+-------+
+| name | type |
++===============+=======+
+| dht.dht_nodes | gauge |
++---------------+-------+
+
+
+The number of nodes in the DHT routing table
+
+.. _dht.dht_node_cache:
+
+.. raw:: html
+
+
+
++--------------------+-------+
+| name | type |
++====================+=======+
+| dht.dht_node_cache | gauge |
++--------------------+-------+
+
+
+The number of replacement nodes in the DHT routing table
+
+.. _dht.dht_torrents:
+
+.. raw:: html
+
+
+
++------------------+-------+
+| name | type |
++==================+=======+
+| dht.dht_torrents | gauge |
++------------------+-------+
+
+
+the number of torrents currently tracked by our DHT node
+
+.. _dht.dht_peers:
+
+.. raw:: html
+
+
+
++---------------+-------+
+| name | type |
++===============+=======+
+| dht.dht_peers | gauge |
++---------------+-------+
+
+
+the number of peers currently tracked by our DHT node
+
+.. _dht.dht_immutable_data:
+
+.. raw:: html
+
+
+
++------------------------+-------+
+| name | type |
++========================+=======+
+| dht.dht_immutable_data | gauge |
++------------------------+-------+
+
+
+the number of immutable data items tracked by our DHT node
+
+.. _dht.dht_mutable_data:
+
+.. raw:: html
+
+
+
++----------------------+-------+
+| name | type |
++======================+=======+
+| dht.dht_mutable_data | gauge |
++----------------------+-------+
+
+
+the number of mutable data items tracked by our DHT node
+
+.. _dht.dht_allocated_observers:
+
+.. raw:: html
+
+
+
++-----------------------------+-------+
+| name | type |
++=============================+=======+
+| dht.dht_allocated_observers | gauge |
++-----------------------------+-------+
+
+
+the number of RPC observers currently allocated
+
+.. _dht.dht_messages_in:
+
+.. _dht.dht_messages_out:
+
+.. raw:: html
+
+
+
+
++----------------------+---------+
+| name | type |
++======================+=========+
+| dht.dht_messages_in | counter |
++----------------------+---------+
+| dht.dht_messages_out | counter |
++----------------------+---------+
+
+
+the total number of DHT messages sent and received
+
+.. _dht.dht_messages_out_dropped:
+
+.. raw:: html
+
+
+
++------------------------------+---------+
+| name | type |
++==============================+=========+
+| dht.dht_messages_out_dropped | counter |
++------------------------------+---------+
+
+
+the number of outgoing messages that failed to be
+sent
+
+.. _dht.dht_bytes_in:
+
+.. _dht.dht_bytes_out:
+
+.. raw:: html
+
+
+
+
++-------------------+---------+
+| name | type |
++===================+=========+
+| dht.dht_bytes_in | counter |
++-------------------+---------+
+| dht.dht_bytes_out | counter |
++-------------------+---------+
+
+
+the total number of bytes sent and received by the DHT
+
+.. _dht.dht_ping_in:
+
+.. _dht.dht_ping_out:
+
+.. _dht.dht_find_node_in:
+
+.. _dht.dht_find_node_out:
+
+.. _dht.dht_get_peers_in:
+
+.. _dht.dht_get_peers_out:
+
+.. _dht.dht_announce_peer_in:
+
+.. _dht.dht_announce_peer_out:
+
+.. _dht.dht_get_in:
+
+.. _dht.dht_get_out:
+
+.. _dht.dht_put_in:
+
+.. _dht.dht_put_out:
+
+.. raw:: html
+
+
+
+
+
+
+
+
+
+
+
+
+
+
++---------------------------+---------+
+| name | type |
++===========================+=========+
+| dht.dht_ping_in | counter |
++---------------------------+---------+
+| dht.dht_ping_out | counter |
++---------------------------+---------+
+| dht.dht_find_node_in | counter |
++---------------------------+---------+
+| dht.dht_find_node_out | counter |
++---------------------------+---------+
+| dht.dht_get_peers_in | counter |
++---------------------------+---------+
+| dht.dht_get_peers_out | counter |
++---------------------------+---------+
+| dht.dht_announce_peer_in | counter |
++---------------------------+---------+
+| dht.dht_announce_peer_out | counter |
++---------------------------+---------+
+| dht.dht_get_in | counter |
++---------------------------+---------+
+| dht.dht_get_out | counter |
++---------------------------+---------+
+| dht.dht_put_in | counter |
++---------------------------+---------+
+| dht.dht_put_out | counter |
++---------------------------+---------+
+
+
+the number of DHT messages we've sent and received
+by kind.
+
+.. _utp.utp_packet_loss:
+
+.. _utp.utp_timeout:
+
+.. _utp.utp_packets_in:
+
+.. _utp.utp_packets_out:
+
+.. _utp.utp_fast_retransmit:
+
+.. _utp.utp_packet_resend:
+
+.. _utp.utp_samples_above_target:
+
+.. _utp.utp_samples_below_target:
+
+.. _utp.utp_payload_pkts_in:
+
+.. _utp.utp_payload_pkts_out:
+
+.. _utp.utp_invalid_pkts_in:
+
+.. _utp.utp_redundant_pkts_in:
+
+.. raw:: html
+
+
+
+
+
+
+
+
+
+
+
+
+
+
++------------------------------+---------+
+| name | type |
++==============================+=========+
+| utp.utp_packet_loss | counter |
++------------------------------+---------+
+| utp.utp_timeout | counter |
++------------------------------+---------+
+| utp.utp_packets_in | counter |
++------------------------------+---------+
+| utp.utp_packets_out | counter |
++------------------------------+---------+
+| utp.utp_fast_retransmit | counter |
++------------------------------+---------+
+| utp.utp_packet_resend | counter |
++------------------------------+---------+
+| utp.utp_samples_above_target | counter |
++------------------------------+---------+
+| utp.utp_samples_below_target | counter |
++------------------------------+---------+
+| utp.utp_payload_pkts_in | counter |
++------------------------------+---------+
+| utp.utp_payload_pkts_out | counter |
++------------------------------+---------+
+| utp.utp_invalid_pkts_in | counter |
++------------------------------+---------+
+| utp.utp_redundant_pkts_in | counter |
++------------------------------+---------+
+
+
+uTP counters
+
+.. _sock_bufs.socket_send_size3:
+
+.. _sock_bufs.socket_send_size4:
+
+.. _sock_bufs.socket_send_size5:
+
+.. _sock_bufs.socket_send_size6:
+
+.. _sock_bufs.socket_send_size7:
+
+.. _sock_bufs.socket_send_size8:
+
+.. _sock_bufs.socket_send_size9:
+
+.. _sock_bufs.socket_send_size10:
+
+.. _sock_bufs.socket_send_size11:
+
+.. _sock_bufs.socket_send_size12:
+
+.. _sock_bufs.socket_send_size13:
+
+.. _sock_bufs.socket_send_size14:
+
+.. _sock_bufs.socket_send_size15:
+
+.. _sock_bufs.socket_send_size16:
+
+.. _sock_bufs.socket_send_size17:
+
+.. _sock_bufs.socket_send_size18:
+
+.. _sock_bufs.socket_send_size19:
+
+.. _sock_bufs.socket_send_size20:
+
+.. _sock_bufs.socket_recv_size3:
+
+.. _sock_bufs.socket_recv_size4:
+
+.. _sock_bufs.socket_recv_size5:
+
+.. _sock_bufs.socket_recv_size6:
+
+.. _sock_bufs.socket_recv_size7:
+
+.. _sock_bufs.socket_recv_size8:
+
+.. _sock_bufs.socket_recv_size9:
+
+.. _sock_bufs.socket_recv_size10:
+
+.. _sock_bufs.socket_recv_size11:
+
+.. _sock_bufs.socket_recv_size12:
+
+.. _sock_bufs.socket_recv_size13:
+
+.. _sock_bufs.socket_recv_size14:
+
+.. _sock_bufs.socket_recv_size15:
+
+.. _sock_bufs.socket_recv_size16:
+
+.. _sock_bufs.socket_recv_size17:
+
+.. _sock_bufs.socket_recv_size18:
+
+.. _sock_bufs.socket_recv_size19:
+
+.. _sock_bufs.socket_recv_size20:
+
+.. raw:: html
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
++------------------------------+---------+
+| name | type |
++==============================+=========+
+| sock_bufs.socket_send_size3 | counter |
++------------------------------+---------+
+| sock_bufs.socket_send_size4 | counter |
++------------------------------+---------+
+| sock_bufs.socket_send_size5 | counter |
++------------------------------+---------+
+| sock_bufs.socket_send_size6 | counter |
++------------------------------+---------+
+| sock_bufs.socket_send_size7 | counter |
++------------------------------+---------+
+| sock_bufs.socket_send_size8 | counter |
++------------------------------+---------+
+| sock_bufs.socket_send_size9 | counter |
++------------------------------+---------+
+| sock_bufs.socket_send_size10 | counter |
++------------------------------+---------+
+| sock_bufs.socket_send_size11 | counter |
++------------------------------+---------+
+| sock_bufs.socket_send_size12 | counter |
++------------------------------+---------+
+| sock_bufs.socket_send_size13 | counter |
++------------------------------+---------+
+| sock_bufs.socket_send_size14 | counter |
++------------------------------+---------+
+| sock_bufs.socket_send_size15 | counter |
++------------------------------+---------+
+| sock_bufs.socket_send_size16 | counter |
++------------------------------+---------+
+| sock_bufs.socket_send_size17 | counter |
++------------------------------+---------+
+| sock_bufs.socket_send_size18 | counter |
++------------------------------+---------+
+| sock_bufs.socket_send_size19 | counter |
++------------------------------+---------+
+| sock_bufs.socket_send_size20 | counter |
++------------------------------+---------+
+| sock_bufs.socket_recv_size3 | counter |
++------------------------------+---------+
+| sock_bufs.socket_recv_size4 | counter |
++------------------------------+---------+
+| sock_bufs.socket_recv_size5 | counter |
++------------------------------+---------+
+| sock_bufs.socket_recv_size6 | counter |
++------------------------------+---------+
+| sock_bufs.socket_recv_size7 | counter |
++------------------------------+---------+
+| sock_bufs.socket_recv_size8 | counter |
++------------------------------+---------+
+| sock_bufs.socket_recv_size9 | counter |
++------------------------------+---------+
+| sock_bufs.socket_recv_size10 | counter |
++------------------------------+---------+
+| sock_bufs.socket_recv_size11 | counter |
++------------------------------+---------+
+| sock_bufs.socket_recv_size12 | counter |
++------------------------------+---------+
+| sock_bufs.socket_recv_size13 | counter |
++------------------------------+---------+
+| sock_bufs.socket_recv_size14 | counter |
++------------------------------+---------+
+| sock_bufs.socket_recv_size15 | counter |
++------------------------------+---------+
+| sock_bufs.socket_recv_size16 | counter |
++------------------------------+---------+
+| sock_bufs.socket_recv_size17 | counter |
++------------------------------+---------+
+| sock_bufs.socket_recv_size18 | counter |
++------------------------------+---------+
+| sock_bufs.socket_recv_size19 | counter |
++------------------------------+---------+
+| sock_bufs.socket_recv_size20 | counter |
++------------------------------+---------+
+
+
+the buffer sizes accepted by
+socket send and receive calls respectively.
+The larger the buffers are, the more efficient,
+because it reqire fewer system calls per byte.
+The size is 1 << n, where n is the number
+at the end of the counter name. i.e.
+8, 16, 32, 64, 128, 256, 512, 1024, 2048, 4096, 8192,
+16384, 32768, 65536, 131072, 262144, 524288, 1048576
+bytes
+
diff --git a/include/libtorrent/performance_counters.hpp b/include/libtorrent/performance_counters.hpp
index 928217561..a03ba9c5e 100644
--- a/include/libtorrent/performance_counters.hpp
+++ b/include/libtorrent/performance_counters.hpp
@@ -38,7 +38,6 @@ POSSIBILITY OF SUCH DAMAGE.
namespace libtorrent
{
- // TODO: 3 does this need to be exported?
struct TORRENT_EXTRA_EXPORT counters
{
enum stats_counter_t