log read job queue size

This commit is contained in:
Arvid Norberg 2011-03-20 09:04:03 +00:00
parent 7c58a45ce3
commit 3d63cb98b7
4 changed files with 7 additions and 2 deletions

View File

@ -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

View File

@ -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']),

View File

@ -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;
}

View File

@ -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;