some more fixes to cache_status
This commit is contained in:
parent
83394f54f9
commit
935eea9d0b
|
@ -122,9 +122,7 @@ namespace libtorrent
|
|||
, cumulative_write_time(0)
|
||||
, cumulative_hash_time(0)
|
||||
, total_read_back(0)
|
||||
#endif
|
||||
, read_queue_size(0)
|
||||
#ifndef TORRENT_NO_DEPRECATE
|
||||
, blocked_jobs(0)
|
||||
, queued_jobs(0)
|
||||
, peak_queued(0)
|
||||
|
@ -228,12 +226,10 @@ namespace libtorrent
|
|||
// they were flushed before the SHA-1 hash got to hash them. If this
|
||||
// is large, a larger cache could significantly improve performance
|
||||
int total_read_back;
|
||||
#endif
|
||||
|
||||
// number of read jobs in the disk job queue
|
||||
int read_queue_size;
|
||||
|
||||
#ifndef TORRENT_NO_DEPRECATE
|
||||
// number of jobs blocked because of a fence
|
||||
int blocked_jobs;
|
||||
|
||||
|
@ -541,10 +537,6 @@ namespace libtorrent
|
|||
|
||||
counters& m_stats_counters;
|
||||
|
||||
// TODO: 3 turn these counters and gauges into session_stats
|
||||
// counters (which also would need to be thread safe)
|
||||
cache_status m_cache_stats;
|
||||
|
||||
// average read time for cache misses (in microseconds)
|
||||
average_accumulator m_read_time;
|
||||
|
||||
|
|
|
@ -2804,7 +2804,6 @@ namespace libtorrent
|
|||
, piece_manager const* storage) const
|
||||
{
|
||||
mutex::scoped_lock l(m_cache_mutex);
|
||||
*ret = m_cache_stats;
|
||||
|
||||
#ifndef TORRENT_NO_DEPRECATE
|
||||
ret->total_used_buffers = m_disk_cache.in_use();
|
||||
|
@ -2837,10 +2836,14 @@ namespace libtorrent
|
|||
|
||||
ret->num_jobs = jobs_in_use();
|
||||
ret->num_read_jobs = read_jobs_in_use();
|
||||
ret->read_queue_size = read_jobs_in_use();
|
||||
ret->num_write_jobs = write_jobs_in_use();
|
||||
ret->pending_jobs = m_stats_counters[counters::num_running_disk_jobs];
|
||||
ret->num_writing_threads = m_stats_counters[counters::num_writing_threads];
|
||||
|
||||
for (int i = 0; i < disk_io_job::num_job_ids; ++i)
|
||||
ret->num_fence_jobs[i] = m_stats_counters[counters::num_fenced_read + i];
|
||||
|
||||
m_disk_cache.get_stats(ret);
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Reference in New Issue