From c1620de8d8d4ba530e29d3d02ff4e172bcc96015 Mon Sep 17 00:00:00 2001 From: Arvid Norberg Date: Sun, 20 Mar 2011 06:37:19 +0000 Subject: [PATCH] sorting needs to count as part of the disk job to get proper proportions of disk thread time metrics --- src/disk_io_thread.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/disk_io_thread.cpp b/src/disk_io_thread.cpp index 1780c9f04..4a3011bdd 100644 --- a/src/disk_io_thread.cpp +++ b/src/disk_io_thread.cpp @@ -1611,6 +1611,10 @@ namespace libtorrent disk_io_job j; + ptime now = time_now_hires(); + m_queue_time.add_sample(total_microseconds(now - j.start_time)); + ptime operation_start = now; + if (!m_jobs.empty()) { // we have a job in the job queue. If it's @@ -1751,13 +1755,8 @@ namespace libtorrent m_ios.post(m_queue_callback); } - ptime now = time_now_hires(); - m_queue_time.add_sample(total_microseconds(now - j.start_time)); - flush_expired_pieces(); - ptime operation_start = now; - int ret = 0; TORRENT_ASSERT(j.storage