added graphing script for bandwidth manager log

This commit is contained in:
Arvid Norberg 2008-01-13 05:14:49 +00:00
parent 56210c1687
commit 9304bd747c
2 changed files with 24 additions and 1 deletions

View File

@ -109,7 +109,7 @@ struct bandwidth_manager
{
#ifdef TORRENT_VERBOSE_BANDWIDTH_LIMIT
if (log)
m_log.open("bandwidth_limiter.log");
m_log.open("bandwidth_limiter.log", std::ios::trunc);
m_start = time_now();
#endif
}

23
parse_bandwidth_log.py Normal file
View File

@ -0,0 +1,23 @@
import os, sys, time
keys = [['upload rate', 'x1y1', 6], ['history entries', 'x1y2', 10], ['queue', 'x1y2', 4]]
out = open('bandwidth.gnuplot', 'wb')
print >>out, "set term png size 1200,700"
print >>out, 'set output "bandwidth_manager.png"'
print >>out, 'set xrange [0:*]'
print >>out, 'set xlabel "time (ms)"'
print >>out, 'set ylabel "Rate (B/s)"'
print >>out, 'set ytics 10000'
print >>out, 'set y2label "number"'
print >>out, 'set y2range [0:*]'
#print >>out, "set style data lines"
print >>out, "set key box"
print >>out, 'plot',
for k, a, c in keys:
print >>out, ' "%s" using 1:%d title "%s" axes %s with steps,' % (sys.argv[1], c, k, a),
print >>out, 'x=0'
out.close()
os.system('gnuplot bandwidth.gnuplot');