mirror of
https://github.com/rakshasa/rtorrent.git
synced 2026-08-09 11:42:33 +00:00
* Added more logging facilities.
* Ignore logging of alloc/dealloc for chunks during initial hashing. * Moved torrent::ResourceManager to 'src/torrent/peer/' and removed old functions from 'torrent.h'. git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@1212 e378c898-3ddf-0310-93e7-cc216c733640
This commit is contained in:
+31
-2
@@ -17,7 +17,35 @@ gnuplot << EOF
|
||||
# 13) $pieces.hash.queue_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.memory.block_count)),((pieces.stats.total_size)),((pieces.hash.queue_size))))
|
||||
#
|
||||
# schedule = log_bandwidth_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)),((pieces.hash.queue_size))))
|
||||
#
|
||||
# 1) system.time_seconds=
|
||||
#
|
||||
# 2) throttle.global_up.rate
|
||||
# 3) throttle.global_up.total
|
||||
# 4) throttle.global_down.rate
|
||||
# 5) throttle.global_down.total
|
||||
#
|
||||
# 9) pieces.memory.current
|
||||
# 10) pieces.memory.sync_queue
|
||||
# 11) pieces.memory.block_count
|
||||
# 12) pieces.stats.total_size
|
||||
# 13) pieces.hash.queue_size
|
||||
#
|
||||
# schedule = log_bandwidth_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)),((pieces.memory.current)),((pieces.memory.sync_queue)),((pieces.memory.block_count)),((pieces.stats.total_size)),((pieces.hash.queue_size))))
|
||||
#
|
||||
# 1) system.time_seconds
|
||||
#
|
||||
# 2) throttle.unchoked_uploads
|
||||
# 3) throttle.unchoked_downloads
|
||||
# 4) network.open_sockets
|
||||
#
|
||||
# 5) view.size,leeching
|
||||
# 6) view.size,seeding
|
||||
# 7) view.size,active
|
||||
#
|
||||
# schedule = log_peer_stats,5,10,((execute,log_rtorrent.sh,((cat,/foo/peer_stats.,((system.pid)))),((system.time_seconds)),((throttle.unchoked_uploads)),((throttle.unchoked_downloads)),((network.open_sockets)),((view.size,leeching)),((view.size,seeding)),((view.size,active))))
|
||||
|
||||
|
||||
set terminal png size 1024,600
|
||||
@@ -56,7 +84,8 @@ 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:11 smooth bezier with lines lw 2 title 'Alloc failed /10s' axis x1y2,\
|
||||
"<awk '{x=\$11/10; print \$1,x}' bandwidth_stats.$1" using 1:2 smooth bezier with lines lw 2 title 'Block count /10' axis x1y2,\
|
||||
"<awk '{x=\$13/10; print \$1,x}' bandwidth_stats.$1" using 1:2 smooth bezier with lines lw 2 title 'Hash queue count /10' axis x1y2
|
||||
"bandwidth_stats.$1" using 1:13 smooth bezier with lines lw 2 title 'Hash queue count' axis x1y2
|
||||
# "<awk '{x=\$13/10; print \$1,x}' bandwidth_stats.$1" using 1:2 smooth bezier with lines lw 2 title 'Hash queue count /10' axis x1y2
|
||||
|
||||
|
||||
#set yrange [*:*]
|
||||
|
||||
@@ -50,6 +50,7 @@
|
||||
#include <torrent/rate.h>
|
||||
#include <torrent/data/file_manager.h>
|
||||
#include <torrent/peer/peer_list.h>
|
||||
#include <torrent/peer/resource_manager.h>
|
||||
#include <torrent/utils/option_strings.h>
|
||||
|
||||
#include "core/dht_manager.h"
|
||||
@@ -636,8 +637,8 @@ initialize_command_network() {
|
||||
CMD2_VAR_STRING ("protocol.choke_heuristics.down.leech", "download_leech");
|
||||
CMD2_VAR_STRING ("protocol.choke_heuristics.down.seed", "download_leech");
|
||||
|
||||
CMD2_ANY ("throttle.unchoked_uploads", std::bind(&torrent::currently_unchoked));
|
||||
CMD2_ANY ("throttle.unchoked_downloads", std::bind(&torrent::download_unchoked));
|
||||
CMD2_ANY ("throttle.unchoked_uploads", std::bind(&torrent::ResourceManager::currently_upload_unchoked, torrent::resource_manager()));
|
||||
CMD2_ANY ("throttle.unchoked_downloads", std::bind(&torrent::ResourceManager::currently_download_unchoked, torrent::resource_manager()));
|
||||
|
||||
CMD2_VAR_VALUE ("throttle.min_peers.normal", 40);
|
||||
CMD2_VAR_VALUE ("throttle.max_peers.normal", 100);
|
||||
@@ -700,6 +701,7 @@ initialize_command_network() {
|
||||
|
||||
CMD2_ANY ("network.max_open_files", std::bind(&torrent::FileManager::max_open_files, fileManager));
|
||||
CMD2_ANY_VALUE_V ("network.max_open_files.set", std::bind(&torrent::FileManager::set_max_open_files, fileManager, std::placeholders::_2));
|
||||
CMD2_ANY ("network.open_sockets", std::bind(&torrent::ConnectionManager::size, cm));
|
||||
CMD2_ANY ("network.max_open_sockets", std::bind(&torrent::ConnectionManager::max_size, cm));
|
||||
CMD2_ANY_VALUE_V ("network.max_open_sockets.set", std::bind(&torrent::ConnectionManager::set_max_size, cm, std::placeholders::_2));
|
||||
|
||||
|
||||
@@ -52,6 +52,7 @@
|
||||
#include <torrent/data/file_list.h>
|
||||
#include <torrent/data/file_manager.h>
|
||||
#include <torrent/peer/client_info.h>
|
||||
#include <torrent/peer/resource_manager.h>
|
||||
|
||||
#include "core/download.h"
|
||||
#include "core/manager.h"
|
||||
@@ -293,12 +294,12 @@ print_status_info(char* first, char* last) {
|
||||
char*
|
||||
print_status_extra(char* first, char* last) {
|
||||
first = print_buffer(first, last, " [U %i/%i]",
|
||||
torrent::currently_unchoked(),
|
||||
torrent::max_unchoked());
|
||||
torrent::resource_manager()->currently_upload_unchoked(),
|
||||
torrent::resource_manager()->max_upload_unchoked());
|
||||
|
||||
first = print_buffer(first, last, " [D %i/%i]",
|
||||
torrent::download_unchoked(),
|
||||
torrent::max_download_unchoked());
|
||||
torrent::resource_manager()->currently_download_unchoked(),
|
||||
torrent::resource_manager()->max_download_unchoked());
|
||||
|
||||
first = print_buffer(first, last, " [H %u/%u]",
|
||||
control->core()->http_stack()->active(),
|
||||
|
||||
+7
-6
@@ -41,6 +41,7 @@
|
||||
#include <sigc++/adaptors/bind.h>
|
||||
#include <torrent/throttle.h>
|
||||
#include <torrent/torrent.h>
|
||||
#include <torrent/peer/resource_manager.h>
|
||||
|
||||
#include "core/manager.h"
|
||||
#include "display/frame.h"
|
||||
@@ -170,7 +171,7 @@ Root::set_down_throttle(unsigned int throttle) {
|
||||
unsigned int global = std::max<int>(rpc::call_command_value("throttle.max_downloads.global"), 0);
|
||||
|
||||
if (throttle == 0 || div == 0) {
|
||||
torrent::set_max_download_unchoked(global);
|
||||
torrent::resource_manager()->set_max_download_unchoked(global);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -184,9 +185,9 @@ Root::set_down_throttle(unsigned int throttle) {
|
||||
maxUnchoked = 10 + throttle / 5;
|
||||
|
||||
if (global != 0)
|
||||
torrent::set_max_download_unchoked(std::min(maxUnchoked, global));
|
||||
torrent::resource_manager()->set_max_download_unchoked(std::min(maxUnchoked, global));
|
||||
else
|
||||
torrent::set_max_download_unchoked(maxUnchoked);
|
||||
torrent::resource_manager()->set_max_download_unchoked(maxUnchoked);
|
||||
}
|
||||
|
||||
void
|
||||
@@ -200,7 +201,7 @@ Root::set_up_throttle(unsigned int throttle) {
|
||||
unsigned int global = std::max<int>(rpc::call_command_value("throttle.max_uploads.global"), 0);
|
||||
|
||||
if (throttle == 0 || div == 0) {
|
||||
torrent::set_max_unchoked(global);
|
||||
torrent::resource_manager()->set_max_upload_unchoked(global);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -214,9 +215,9 @@ Root::set_up_throttle(unsigned int throttle) {
|
||||
maxUnchoked = 10 + throttle / 5;
|
||||
|
||||
if (global != 0)
|
||||
torrent::set_max_unchoked(std::min(maxUnchoked, global));
|
||||
torrent::resource_manager()->set_max_upload_unchoked(std::min(maxUnchoked, global));
|
||||
else
|
||||
torrent::set_max_unchoked(maxUnchoked);
|
||||
torrent::resource_manager()->set_max_upload_unchoked(maxUnchoked);
|
||||
}
|
||||
|
||||
void
|
||||
|
||||
Reference in New Issue
Block a user