diff --git a/include/libtorrent/disk_io_thread.hpp b/include/libtorrent/disk_io_thread.hpp index 7bb5413db..dd9cfd14e 100644 --- a/include/libtorrent/disk_io_thread.hpp +++ b/include/libtorrent/disk_io_thread.hpp @@ -181,6 +181,7 @@ namespace libtorrent , cumulative_hash_time(0) , cumulative_sort_time(0) , total_read_back(0) + , read_queue_size(0) {} // the number of 16kB blocks written @@ -225,6 +226,7 @@ namespace libtorrent boost::uint32_t cumulative_hash_time; boost::uint32_t cumulative_sort_time; int total_read_back; + int read_queue_size; }; struct TORRENT_EXPORT disk_buffer_pool : boost::noncopyable diff --git a/parse_session_stats.py b/parse_session_stats.py index 650ce7c1d..3399add2c 100755 --- a/parse_session_stats.py +++ b/parse_session_stats.py @@ -90,7 +90,7 @@ reports = [ ('disk_cache_hits', 'blocks (16kiB)', '', ['disk block read', 'read cache hits', 'disk block written', 'disk read back']), ('disk_cache', 'blocks (16kiB)', 'disk cache size and usage', ['read disk cache size', 'disk cache size', 'disk buffer allocations', 'cache size']), ('disk_readback', '% of written blocks', '', ['% read back']), -# ('disk_queue', 'num', '', ['disk queue size', 'disk queued bytes']), + ('disk_queue', 'num', '', ['disk queue size', 'disk read queue size']), # ('absolute_waste', 'num', '', ['failed bytes', 'redundant bytes', 'download rate']), ('connect_candidates', 'num', 'number of peers we know of that we can connect to', ['connect candidates']), diff --git a/src/disk_io_thread.cpp b/src/disk_io_thread.cpp index 53e7d7370..e39d3f04d 100644 --- a/src/disk_io_thread.cpp +++ b/src/disk_io_thread.cpp @@ -348,6 +348,7 @@ namespace libtorrent ret.average_job_time = m_job_time.mean(); ret.average_sort_time = m_sort_time.mean(); ret.job_queue_length = m_jobs.size() + m_sorted_read_jobs.size(); + ret.read_queue_size = m_sorted_read_jobs.size(); return ret; } diff --git a/src/session_impl.cpp b/src/session_impl.cpp index 4473ae1fa..c5caa16af 100644 --- a/src/session_impl.cpp +++ b/src/session_impl.cpp @@ -965,6 +965,7 @@ namespace aux { ":% sort time" ":disk read back" ":% read back" + ":disk read queue size" "\n\n", m_stats_logger); } #endif @@ -2758,7 +2759,7 @@ namespace aux { "%f\t%f\t%f\t%d\t%d\t%d\t%d\t%d\t%d\t%d\t" "%d\t%d\t%d\t%d\t%d\t%d\t%d\t%d\t%d\t%d\t" "%d\t%d\t%d\t%d\t%d\t%d\t%d\t%d\t%f\t%f\t" - "%f\t%f\t%d\t%f\n" + "%f\t%f\t%d\t%f\t%d\n" , total_milliseconds(now - m_last_log_rotation) / 1000.f , int(m_stat.total_upload() - m_last_uploaded) , int(m_stat.total_download() - m_last_downloaded) @@ -2853,6 +2854,7 @@ namespace aux { , float(cs.cumulative_sort_time * 100.f / total_job_time) , int(cs.total_read_back - m_last_cache_status.total_read_back) , float(cs.total_read_back * 100.f / (cs.blocks_written == 0 ? 1: cs.blocks_written)) + , cs.read_queue_size ); m_last_cache_status = cs; m_last_failed = m_total_failed_bytes;