From cb45e30aeba12938c412bd2812b8780f97f5365e Mon Sep 17 00:00:00 2001 From: rakshasa Date: Tue, 12 Apr 2011 04:08:33 +0000 Subject: [PATCH] * Be more aggressive about freeing references to downloading / downloaded pieces when a peer connection sends choke or has an empty queue. git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@1208 e378c898-3ddf-0310-93e7-cc216c733640 --- doc/log_stats.plot | 16 ++++++++++++++-- src/command_local.cc | 1 + 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/doc/log_stats.plot b/doc/log_stats.plot index e3c2bc70..8e7fab29 100644 --- a/doc/log_stats.plot +++ b/doc/log_stats.plot @@ -12,10 +12,11 @@ gnuplot << EOF # 8) $view.size=active # 9) $pieces.memory.current= # 10) $pieces.memory.sync_queue= -# 11) $pieces.stats.total_size= +# 11) $pieces.memory.block_count= +# 12) $pieces.stats.total_size= # # log.libtorrent = mincore_stats,(cat,"/foo/mincore_stats.",(system.pid)) -# schedule = log_stats,5,10,((execute,log_rtorrent.sh,((cat,/foo/bandwidth_stats.,((system.pid)))),((system.time_seconds)),((throttle.global_up.rate)),((throttle.global_up.total)),((throttle.global_down.rate)),((throttle.global_down.total)),((throttle.unchoked_uploads)),((throttle.unchoked_downloads)),((view.size,active)),((pieces.memory.current)),((pieces.memory.sync_queue)),((pieces.stats.total_size)))) +# schedule = log_stats,5,10,((execute,log_rtorrent.sh,((cat,/foo/bandwidth_stats.,((system.pid)))),((system.time_seconds)),((throttle.global_up.rate)),((throttle.global_up.total)),((throttle.global_down.rate)),((throttle.global_down.total)),((throttle.unchoked_uploads)),((throttle.unchoked_downloads)),((view.size,active)),((pieces.memory.current)),((pieces.memory.sync_queue)),((pieces.memory.block_count)),((pieces.stats.total_size)))) set terminal png size 1024,600 @@ -40,6 +41,9 @@ plot "bandwidth_stats.$1" using 1:9 smooth bezier with lines lw 4 title 'Memory "bandwidth_stats.$1" using 1:6 smooth bezier with lines lw 2 title 'Upload unchoked' axis x1y2,\ "bandwidth_stats.$1" using 1:7 smooth bezier with lines lw 2 title 'Download unchoked' axis x1y2 +set yrange [0:3900000000.0] +set y2range [0:2000] + set output "output_$1_pieces.png" plot "bandwidth_stats.$1" using 1:9 smooth bezier with lines lw 4 title 'Memory usage' axis x1y1,\ "bandwidth_stats.$1" using 1:10 smooth bezier with lines lw 4 title 'Sync queue Memory' axis x1y1,\ @@ -49,6 +53,14 @@ plot "bandwidth_stats.$1" using 1:9 smooth bezier with lines lw 4 title 'Memory "mincore_stats.$1" using 1:8 smooth bezier with lines lw 2 title 'Sync failed /10s' axis x1y2,\ "mincore_stats.$1" using 1:9 smooth bezier with lines lw 2 title 'Alloc failed /10s' axis x1y2 +set yrange [*:*] +set y2range [*:*] + +set format y2 "%.0s %cb" +set output "output_$1_torrents.png" +plot "bandwidth_stats.$1" using 1:9 smooth bezier with lines lw 4 title 'Memory usage' axis x1y1,\ + "bandwidth_stats.$1" using 1:12 smooth bezier with lines lw 2 title 'Pieces total size' axis x1y2 + set format y "%.0f" set output "output_$1_incore.png" diff --git a/src/command_local.cc b/src/command_local.cc index 1a9d1801..8b5c4061 100644 --- a/src/command_local.cc +++ b/src/command_local.cc @@ -304,6 +304,7 @@ initialize_command_local() { CMD2_ANY ("pieces.memory.current", std::bind(&CM_t::memory_usage, chunkManager)); CMD2_ANY ("pieces.memory.sync_queue", std::bind(&CM_t::sync_queue_memory_usage, chunkManager)); + CMD2_ANY ("pieces.memory.block_count", std::bind(&CM_t::memory_block_count, chunkManager)); CMD2_ANY ("pieces.memory.max", std::bind(&CM_t::max_memory_usage, chunkManager)); CMD2_ANY_VALUE_V ("pieces.memory.max.set", std::bind(&CM_t::set_max_memory_usage, chunkManager, std::placeholders::_2)); CMD2_ANY ("pieces.stats_preloaded", std::bind(&CM_t::stats_preloaded, chunkManager));