read time is only cache misses

This commit is contained in:
Arvid Norberg 2010-03-04 03:49:06 +00:00
parent fb8e1d8611
commit 9edb348093
2 changed files with 8 additions and 3 deletions

View File

@ -856,7 +856,8 @@ used in peer connections.
has to wait in the job queue before it get processed.
``average_read_time`` is the number of microseconds a read job takes to
wait in the queue and complete, in microseconds.
wait in the queue and complete, in microseconds. This only includes
cache misses.
``job_queue_length`` is the number of jobs in the job queue.

View File

@ -1868,6 +1868,12 @@ namespace libtorrent
break;
}
++m_cache_stats.blocks_read;
hit = false;
}
if (!hit)
{
ptime now = time_now_hires();
m_read_time.add_sample(total_microseconds(now - j.start_time));
}
TORRENT_ASSERT(j.buffer == read_holder.get());
read_holder.release();
@ -2227,8 +2233,6 @@ namespace libtorrent
&& j.buffer != 0)
rename_buffer(j.buffer, "posted send buffer");
#endif
ptime now = time_now_hires();
m_read_time.add_sample(total_microseconds(now - j.start_time));
post_callback(j.callback, j, ret);
#ifndef BOOST_NO_EXCEPTIONS
} catch (std::exception&)