log average disk job time instead of cache time

This commit is contained in:
Arvid Norberg 2011-03-18 03:07:10 +00:00
parent 3734ccae24
commit 782bc974a1
3 changed files with 9 additions and 9 deletions

View File

@ -171,7 +171,7 @@ namespace libtorrent
, average_read_time(0) , average_read_time(0)
, average_write_time(0) , average_write_time(0)
, average_hash_time(0) , average_hash_time(0)
, average_cache_time(0) , average_job_time(0)
, average_sort_time(0) , average_sort_time(0)
, job_queue_length(0) , job_queue_length(0)
{} {}
@ -208,7 +208,7 @@ namespace libtorrent
int average_read_time; int average_read_time;
int average_write_time; int average_write_time;
int average_hash_time; int average_hash_time;
int average_cache_time; int average_job_time;
int average_sort_time; int average_sort_time;
int job_queue_length; int job_queue_length;
}; };
@ -450,9 +450,8 @@ namespace libtorrent
// average hash time (in microseconds) // average hash time (in microseconds)
sliding_average<512> m_hash_time; sliding_average<512> m_hash_time;
// average disk cache time (in microseconds) // average time to serve a job (any job) in microseconds
// scanning the cache for pieces to flush sliding_average<512> m_job_time;
sliding_average<512> m_cache_time;
// average time to ask for physical offset on disk // average time to ask for physical offset on disk
// and insert into queue // and insert into queue

View File

@ -343,7 +343,7 @@ namespace libtorrent
ret.average_read_time = m_read_time.mean(); ret.average_read_time = m_read_time.mean();
ret.average_write_time = m_write_time.mean(); ret.average_write_time = m_write_time.mean();
ret.average_hash_time = m_hash_time.mean(); ret.average_hash_time = m_hash_time.mean();
ret.average_cache_time = m_cache_time.mean(); ret.average_job_time = m_job_time.mean();
ret.average_sort_time = m_sort_time.mean(); ret.average_sort_time = m_sort_time.mean();
ret.job_queue_length = m_jobs.size() + m_sorted_read_jobs.size(); ret.job_queue_length = m_jobs.size() + m_sorted_read_jobs.size();
@ -1712,7 +1712,6 @@ namespace libtorrent
flush_expired_pieces(); flush_expired_pieces();
ptime operation_start = time_now_hires(); ptime operation_start = time_now_hires();
m_cache_time.add_sample(total_microseconds(operation_start - now));
int ret = 0; int ret = 0;
@ -2413,6 +2412,8 @@ namespace libtorrent
TORRENT_ASSERT(!j.storage || !j.storage->error()); TORRENT_ASSERT(!j.storage || !j.storage->error());
m_job_time.add_sample(total_microseconds(operation_start - now));
// if (!j.callback) std::cerr << "DISK THREAD: no callback specified" << std::endl; // if (!j.callback) std::cerr << "DISK THREAD: no callback specified" << std::endl;
// else std::cerr << "DISK THREAD: invoking callback" << std::endl; // else std::cerr << "DISK THREAD: invoking callback" << std::endl;
TORRENT_TRY { TORRENT_TRY {

View File

@ -949,7 +949,7 @@ namespace aux {
":disk cache size" ":disk cache size"
":disk buffer allocations" ":disk buffer allocations"
":disk hash time" ":disk hash time"
":disk cache time" ":disk job time"
":disk sort time" ":disk sort time"
":connection attempts" ":connection attempts"
":banned peers" ":banned peers"
@ -2810,7 +2810,7 @@ namespace aux {
, cs.cache_size , cs.cache_size
, cs.total_used_buffers , cs.total_used_buffers
, int(cs.average_hash_time) , int(cs.average_hash_time)
, int(cs.average_cache_time) , int(cs.average_job_time)
, int(cs.average_sort_time) , int(cs.average_sort_time)
, m_connection_attempts , m_connection_attempts
, m_num_banned_peers , m_num_banned_peers