mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-11-20 02:09:24 +01:00
commit a short script to do lots of fetches through tor at once
when you do 20 or so at once, things start going odd. might be privoxy, might be tor. svn:r2927
This commit is contained in:
parent
bb18d4238f
commit
67ac11c2fa
30
contrib/tor-stress
Executable file
30
contrib/tor-stress
Executable file
@ -0,0 +1,30 @@
|
||||
#!/usr/bin/perl
|
||||
|
||||
require 'sys/syscall.ph';
|
||||
use POSIX qw(strftime);
|
||||
$|=1;
|
||||
|
||||
$total = 1;
|
||||
|
||||
for($i=0;$i<$total;$i++) {
|
||||
print "Starting client $i\n";
|
||||
$pid = fork();
|
||||
if(!$pid) {
|
||||
open(FD,"wget -q -O - http://www.cnn.com/|");
|
||||
$c = 0;
|
||||
while(<FD>) {
|
||||
$c += length($_);
|
||||
}
|
||||
($s, $usec) = gettimeofday;
|
||||
$TIMEVAL_T = "LL";
|
||||
$now = pack($TIMEVAL_T, ());
|
||||
syscall(&SYS_gettimeofday, $now, 0) != -1 or die "gettimeofday: $!";
|
||||
@now = unpack($TIMEVAL_T, $now);
|
||||
# $now_string = strftime "%b %d %H:%M:%S", gmtime;
|
||||
# $now_string .= $now[1]/1000;
|
||||
print "Client $i exiting ($c chars: $now[1]).\n";
|
||||
exit(0);
|
||||
}
|
||||
# sleep(1);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user