add some more options to client_test, useful when running benchmarks

This commit is contained in:
Arvid Norberg 2011-05-02 05:32:54 +00:00
parent 434a84bdc2
commit 0255cbc839
1 changed files with 7 additions and 1 deletions

View File

@ -898,6 +898,9 @@ int main(int argc, char* argv[])
" -n announce to trackers in all tiers\n" " -n announce to trackers in all tiers\n"
" -W <num peers> Set the max number of peers to keep in the peer list\n" " -W <num peers> Set the max number of peers to keep in the peer list\n"
" -r <ratio> sets the preferred share ratio\n" " -r <ratio> sets the preferred share ratio\n"
" -B <seconds> sets the peer timeout\n"
" -Q enables share mode. Share mode attempts to maximize\n"
" share ratio rather than downloading\n"
"\n QUEING OPTIONS\n" "\n QUEING OPTIONS\n"
" -v <limit> Set the max number of active downloads\n" " -v <limit> Set the max number of active downloads\n"
" -^ <limit> Set the max number of active seeds\n" " -^ <limit> Set the max number of active seeds\n"
@ -924,6 +927,7 @@ int main(int argc, char* argv[])
#if TORRENT_USE_I2P #if TORRENT_USE_I2P
" -i <i2p-host> the hostname to an I2P SAM bridge to use\n" " -i <i2p-host> the hostname to an I2P SAM bridge to use\n"
#endif #endif
" -l <limit> sets the listen socket queue size\n"
"\n DISK OPTIONS\n" "\n DISK OPTIONS\n"
" -a <mode> sets the allocation mode. [compact|full]\n" " -a <mode> sets the allocation mode. [compact|full]\n"
" -R <num blocks> number of blocks per read cache line\n" " -R <num blocks> number of blocks per read cache line\n"
@ -937,7 +941,7 @@ int main(int argc, char* argv[])
"URL is a url to a torrent file\n" "URL is a url to a torrent file\n"
"\n" "\n"
"Example for running benchmark:\n\n" "Example for running benchmark:\n\n"
" client_test -k -N -h -H -M -S 1000 -T 1000 -c 1000 test.torrent\n"); " client_test -k -z -N -h -H -M -l 2000 -S 1000 -T 1000 -c 1000 test.torrent\n");
; ;
return 0; return 0;
} }
@ -1039,6 +1043,7 @@ int main(int argc, char* argv[])
preferred_ratio = atoi(arg); preferred_ratio = atoi(arg);
if (preferred_ratio != 0 && preferred_ratio < 1.f) preferred_ratio = 1.f; if (preferred_ratio != 0 && preferred_ratio < 1.f) preferred_ratio = 1.f;
break; break;
case 'B': settings.peer_timeout = atoi(arg); break;
case 'n': settings.announce_to_all_tiers = true; --i; break; case 'n': settings.announce_to_all_tiers = true; --i; break;
case 'd': settings.download_rate_limit = atoi(arg) * 1000; break; case 'd': settings.download_rate_limit = atoi(arg) * 1000; break;
case 'u': settings.upload_rate_limit = atoi(arg) * 1000; break; case 'u': settings.upload_rate_limit = atoi(arg) * 1000; break;
@ -1057,6 +1062,7 @@ int main(int argc, char* argv[])
case 't': poll_interval = atoi(arg); break; case 't': poll_interval = atoi(arg); break;
case 'F': refresh_delay = atoi(arg); break; case 'F': refresh_delay = atoi(arg); break;
case 'H': start_dht = false; --i; break; case 'H': start_dht = false; --i; break;
case 'l': settings.listen_queue_size = atoi(arg); break;
case 'W': case 'W':
settings.max_peerlist_size = atoi(arg); settings.max_peerlist_size = atoi(arg);
settings.max_paused_peerlist_size = atoi(arg) / 2; settings.max_paused_peerlist_size = atoi(arg) / 2;