log a low-pass filtered iops to stats log

This commit is contained in:
Arvid Norberg 2011-07-03 17:21:45 +00:00
parent 2c07e488b1
commit de3ea9214a
3 changed files with 11 additions and 1 deletions

View File

@ -933,6 +933,8 @@ namespace libtorrent
int m_num_banned_peers;
int m_banned_for_hash_failure;
vm_statistics_data_t m_last_vm_stat;
sliding_average<5> m_read_ops;
sliding_average<5> m_write_ops;;
#endif
// each second tick the timer takes a little

View File

@ -120,7 +120,7 @@ reports = [
('disk_cache', 'blocks (16kiB)', '', 'disk cache size and usage', ['read disk cache size', 'disk cache size', 'disk buffer allocations', 'cache size']),
('disk_readback', '% of written blocks', '%%', 'portion of written blocks that had to be read back for hash verification', ['% read back']),
('disk_queue', 'number of queued disk jobs', '', 'queued disk jobs', ['disk queue size', 'disk read queue size', 'read job queue size limit']),
('disk_iops', 'operations/s', '', 'number of disk operations per second', ['read ops/s', 'write ops/s']),
('disk_iops', 'operations/s', '', 'number of disk operations per second', ['read ops/s', 'write ops/s', 'smooth read ops/s', 'smooth write ops/s']),
('mixed mode', 'rate', 'B/s', 'rates by transport protocol', ['TCP up rate','TCP down rate','uTP up rate','uTP down rate','TCP up limit','TCP down limit']),
('uTP delay', 'buffering delay', 's', 'network delays measured by uTP', ['uTP peak send delay','uTP avg send delay']),
('system memory', '', '', 'virtual memory page count', ['active resident pages', 'inactive resident pages', 'pinned resident pages', 'free pages']),

View File

@ -981,6 +981,8 @@ namespace aux {
":pageins"
":pageouts"
":page faults"
":smooth read ops/s"
":smooth write ops/s"
"\n\n", m_stats_logger);
}
#endif
@ -3271,6 +3273,9 @@ namespace aux {
{
cache_status cs = m_disk_thread.status();
m_read_ops.add_sample((cs.reads - m_last_cache_status.reads) * 1000.0 / float(tick_interval_ms));
m_write_ops.add_sample((cs.writes - m_last_cache_status.writes) * 1000.0 / float(tick_interval_ms));
int total_job_time = cs.cumulative_job_time == 0 ? 1 : cs.cumulative_job_time;
#define STAT_LOG(type, val) fprintf(m_stats_logger, "%" #type "\t", val)
@ -3396,6 +3401,9 @@ namespace aux {
STAT_LOG(d, int(vm_stat.pageouts - m_last_vm_stat.pageouts));
STAT_LOG(d, int(vm_stat.faults - m_last_vm_stat.faults));
STAT_LOG(d, m_read_ops.mean());
STAT_LOG(d, m_write_ops.mean());
fprintf(m_stats_logger, "\n");
#undef STAT_LOG