summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoger Dingledine <arma@torproject.org>2004-11-21 06:35:22 +0000
committerRoger Dingledine <arma@torproject.org>2004-11-21 06:35:22 +0000
commit67ac11c2fab6f1b6ce561fcf783defca91fe8caf (patch)
tree0976f58d6bba59c66e4d96138b40d489c236545d
parentbb18d4238f292648e75c6fd50bdd434ab193fa71 (diff)
downloadtor-67ac11c2fab6f1b6ce561fcf783defca91fe8caf.tar.gz
tor-67ac11c2fab6f1b6ce561fcf783defca91fe8caf.zip
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
-rwxr-xr-xcontrib/tor-stress30
1 files changed, 30 insertions, 0 deletions
diff --git a/contrib/tor-stress b/contrib/tor-stress
new file mode 100755
index 0000000000..ac82973aa3
--- /dev/null
+++ b/contrib/tor-stress
@@ -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);
+}
+