transition fenced job histogram to session stats gauges. deprecate it from cache_status

This commit is contained in:
Arvid Norberg 2014-10-25 20:59:54 +00:00
parent 0bcbe433ed
commit 83394f54f9
4 changed files with 51 additions and 7 deletions

View File

@ -112,9 +112,7 @@ namespace libtorrent
, write_cache_size(0)
, read_cache_size(0)
, pinned_blocks(0)
#endif
, total_used_buffers(0)
#ifndef TORRENT_NO_DEPRECATE
, average_read_time(0)
, average_write_time(0)
, average_hash_time(0)
@ -143,7 +141,9 @@ namespace libtorrent
, num_writing_threads(0)
#endif
{
#ifndef TORRENT_NO_DEPRECATE
memset(num_fence_jobs, 0, sizeof(num_fence_jobs));
#endif
}
std::vector<cached_piece_info> pieces;
@ -191,7 +191,6 @@ namespace libtorrent
// the number of blocks with a refcount > 0, i.e.
// they may not be evicted
int pinned_blocks;
#endif
// the total number of buffers currently in use.
// This includes the read/write disk cache as well as send and receive buffers
@ -201,7 +200,6 @@ namespace libtorrent
// the number of microseconds an average disk I/O job
// has to wait in the job queue before it get processed.
#ifndef TORRENT_NO_DEPRECATE
// the time read jobs takes on average to complete
// (not including the time in the queue), in microseconds. This only measures
// read cache misses.
@ -272,11 +270,11 @@ namespace libtorrent
// the number of threads currently writing to disk
int num_writing_threads;
#endif
// counts only fence jobs that are currently blocking jobs
// not fences that are themself blocked
int num_fence_jobs[disk_io_job::num_job_ids];
#endif
};
// this is a singleton consisting of the thread and a queue

View File

@ -366,6 +366,26 @@ namespace libtorrent
queued_write_bytes,
num_unchoke_slots,
num_fenced_read,
num_fenced_write,
num_fenced_hash,
num_fenced_move_storage,
num_fenced_release_files,
num_fenced_delete_files,
num_fenced_check_fastresume,
num_fenced_save_resume_data,
num_fenced_rename_file,
num_fenced_stop_torrent,
num_fenced_cache_piece,
num_fenced_flush_piece,
num_fenced_flush_hashed,
num_fenced_flush_storage,
num_fenced_trim_cache,
num_fenced_file_priority,
num_fenced_load_torrent,
num_fenced_clear_piece,
num_fenced_tick_storage,
arc_mru_size,
arc_mru_ghost_size,
arc_mfu_size,

View File

@ -3062,7 +3062,7 @@ namespace libtorrent
, job_action_name[j->action]
, j->storage->num_outstanding_jobs());
++m_cache_stats.num_fence_jobs[j->action];
m_stats_counters.inc_stats_counter(counters::num_fenced_read + j->action);
disk_io_job* fj = allocate_job(disk_io_job::flush_storage);
fj->storage = j->storage;
@ -3351,7 +3351,11 @@ namespace libtorrent
if (j->storage)
{
if (j->flags & disk_io_job::fence)
--m_cache_stats.num_fence_jobs[j->action];
{
m_stats_counters.inc_stats_counter(
counters::num_fenced_read + j->action, -1);
}
ret += j->storage->job_complete(j, new_jobs);
}
TORRENT_ASSERT(ret == new_jobs.size());

View File

@ -369,6 +369,28 @@ namespace libtorrent
METRIC(disk, disk_hash_time)
METRIC(disk, disk_job_time)
// for each kind of disk job, a counter of how many jobs of that kind
// are currently blocked by a disk fence
METRIC(disk, num_fenced_read)
METRIC(disk, num_fenced_write)
METRIC(disk, num_fenced_hash)
METRIC(disk, num_fenced_move_storage)
METRIC(disk, num_fenced_release_files)
METRIC(disk, num_fenced_delete_files)
METRIC(disk, num_fenced_check_fastresume)
METRIC(disk, num_fenced_save_resume_data)
METRIC(disk, num_fenced_rename_file)
METRIC(disk, num_fenced_stop_torrent)
METRIC(disk, num_fenced_cache_piece)
METRIC(disk, num_fenced_flush_piece)
METRIC(disk, num_fenced_flush_hashed)
METRIC(disk, num_fenced_flush_storage)
METRIC(disk, num_fenced_trim_cache)
METRIC(disk, num_fenced_file_priority)
METRIC(disk, num_fenced_load_torrent)
METRIC(disk, num_fenced_clear_piece)
METRIC(disk, num_fenced_tick_storage)
// The number of nodes in the DHT routing table
METRIC(dht, dht_nodes)