From e1f0ee86b7620f21f6c7737361d19bd501b72979 Mon Sep 17 00:00:00 2001 From: rakshasa Date: Wed, 25 Aug 2010 07:14:19 +0000 Subject: [PATCH] * Some debugging tools added. git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@1172 e378c898-3ddf-0310-93e7-cc216c733640 --- doc/debugging | 11 +++++++++++ doc/log_rtorrent.sh | 3 +++ doc/log_stats.plot | 37 +++++++++++++++++++++++++++++++++++++ src/command_network.cc | 3 +++ 4 files changed, 54 insertions(+) create mode 100644 doc/debugging create mode 100755 doc/log_rtorrent.sh create mode 100644 doc/log_stats.plot diff --git a/doc/debugging b/doc/debugging new file mode 100644 index 00000000..58462bd7 --- /dev/null +++ b/doc/debugging @@ -0,0 +1,11 @@ +=== Dumping core files on mac == + +ulimit -c unlimited +sysctl kern.corefile + + +schedule = log_vmmap,5,600,"execute_nothrow=/Users/rakshasa/trunk/rtorrent/doc/log_vmmap.sh,\"$cat=/Users/rakshasa/Downloads/session/vmmap.system.,$system.pid="; log.vmmap.dump=\"$cat=/Users/rakshasa/Downloads/session/vmmap.rtorrent.,$system.pid=\"" + +log.vmmap.dump="$cat=/Users/rakshasa/Downloads/session/vmmap.rtorrent.,$system.pid=" + +print="$cat=/Users/rakshasa/Downloads/session/vmmap.rtorrent.,$system.pid=" diff --git a/doc/log_rtorrent.sh b/doc/log_rtorrent.sh new file mode 100755 index 00000000..28b72d42 --- /dev/null +++ b/doc/log_rtorrent.sh @@ -0,0 +1,3 @@ +#!/bin/bash +args=($@) +echo "${args[@]:1}" >> $1 diff --git a/doc/log_stats.plot b/doc/log_stats.plot new file mode 100644 index 00000000..78429602 --- /dev/null +++ b/doc/log_stats.plot @@ -0,0 +1,37 @@ +# $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= +# $pieces.memory.current= +# +# schedule = log_stats,5,10,"execute={log_rtorrent.sh,/Users/rakshasa/tmp/rtorrent.log,$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=,$pieces.memory.current=}" + + +set terminal png +set output "output.png" +set xdata time +set timefmt "%s" +set format x "%H:%M" + +#set multiplot + +plot "./rtorrent.log" using 1:2 smooth bezier with lines title 'Upload rate',\ + "./rtorrent.log" using 1:4 smooth bezier with lines title 'Download rate',\ + "./rtorrent.log" using 1:6 smooth bezier with lines title 'Upload unchoked' axis x1y2,\ + "./rtorrent.log" using 1:7 smooth bezier with lines title 'Download unchoked' axis x1y2 + +set output "output_2.png" + +plot "./rtorrent.log" using 1:8 smooth bezier with lines title 'Memory usage' axis x1y1 + +set output "output_incore.png" + +plot "/tmp/rtorrent.incore.8032" using 1:2 smooth bezier with lines title 'Incore cont.' axis x1y1,\ + "/tmp/rtorrent.incore.8032" using 1:4 smooth bezier with lines title 'Not incore cont.' axis x1y1,\ + "/tmp/rtorrent.incore.8032" using 1:3 smooth bezier with lines title 'Incore new' axis x1y1,\ + "/tmp/rtorrent.incore.8032" using 1:5 smooth bezier with lines title 'Not incore new' axis x1y1 diff --git a/src/command_network.cc b/src/command_network.cc index ef046df4..0d3e160e 100644 --- a/src/command_network.cc +++ b/src/command_network.cc @@ -420,6 +420,9 @@ initialize_command_network() { CMD2_VAR_STRING("connection_leech", "leech"); CMD2_VAR_STRING("connection_seed", "seed"); + CMD2_ANY ("throttle.unchoked_uploads", std::tr1::bind(&torrent::currently_unchoked)); + CMD2_ANY ("throttle.unchoked_downloads", std::tr1::bind(&torrent::download_unchoked)); + CMD2_VAR_VALUE ("throttle.min_peers.normal", 40); CMD2_VAR_VALUE ("throttle.max_peers.normal", 100); CMD2_VAR_VALUE ("throttle.min_peers.seed", -1);