fi
if [ ! -e ~/include/gtest/gtest.h ]; then
+ echo installing gtest
mkdir tmp
cd tmp || exit -3
wget -c http://googletest.googlecode.com/files/gtest-1.4.0.tar.bz2 || exit -2
./configure --prefix=$HOME || exit 2
make || exit 3
make install || exit 4
+ echo done gtest
fi
+#if ! which pcregrep ; then
+# echo installing pcregrep
+# mkdir tmp
+# cd tmp
+# wget ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.01.tar.gz || exit 5
+# tar -xzf pcre-8.01.tar.gz
+# cd pcre-8.01
+# ./configure --prefix=$HOME || exit 6
+# make -j4 || exit 7
+# make install || exit 8
+# echo done pcregrep
+#fi
+
if [ ! -e swift ]; then
- git clone git://github.com/gritzko/swift.git || exit 6
+ echo clone the repo
+ git clone $ORIGIN || exit 6
fi
cd swift
-git pull || exit 5
+echo pulling updates
+git pull origin $BRANCH:$BRANCH || exit 5
+echo switching the branch
+git checkout $BRANCH || exit 5
+echo building
CPPPATH=~/include LIBPATH=~/lib scons -j4 || exit 7
+echo testing
tests/connecttest || exit 8
-
+echo done
# docmd.sh); all failed executions are
# put to the FAILURES file
rm -f FAILURES
-rm -rf logs
-mkdir logs
+if [ ! -d logs ]; then
+ mkdir logs
+fi
if [ -z "$SERVERS" ]; then
SERVERS="servers.txt"
# This script sets up shared environment variables
# at the servers
-export SEEDER=#YOUR IP HERE#
-export SEEDPORT=10001
-export RUNPORT=10002
+export SEEDER=130.161.211.198
+export SEEDPORT=10004
+export RUNPORT=10008
+export BRANCH=swiftapp
+export ORIGIN=git://github.com/gritzko/swift.git
--- /dev/null
+#!/bin/bash
+
+if [ -z "$SERVERS" ]; then
+ SERVERS="servers.txt"
+fi
+
+cd harvest
+
+for from in `grep -v '^#' ../$SERVERS`; do
+ for to in `grep -v '^#' ../$SERVERS`; do
+ CWNDLOG="$from-$to-cwnd.log"
+ if [ ! -e $CWNDLOG ]; then
+ continue
+ fi
+ GP="$from-$to.gnuplot"
+ echo "set term png large size 1024,768" > $GP
+ PNG="$from-$to.png"
+ if [ -e $PNG ]; then rm $PNG; fi
+ echo "set out '$from-$to.png'" >> $GP
+ echo "set y2tics" >> $GP
+ echo "set y2label 'packets'" >> $GP
+ echo "set ylabel 'microseconds'" >> $GP
+ echo "set xlabel 'run time millis'" >> $GP
+ CWNDLOG="$from-$to-cwnd.log"
+ echo -ne "plot '$CWNDLOG' using 1:2 with lines title 'cwnd'"\
+ " axis x1y2, "\
+ " '$CWNDLOG' using 1:3 with lines title 'data out'"\
+ " axis x1y2 "\
+ >> $GP
+ RTTLOG="$from-$to-rtt.log"
+ if [ -e $RTTLOG ]; then
+ echo -ne ", '$RTTLOG' using 1:2 with lines title 'rtt' "\
+ "axis x1y1, "\
+ "'$RTTLOG' using 1:3 with lines title 'dev' "\
+ "axis x1y1"\
+ >> $GP
+ fi
+ OWDLOG="$from-$to-owd.log"
+ if [ -e $OWDLOG ]; then
+ echo -ne ", '$OWDLOG' using 1:2 with lines title 'owd' "\
+ "axis x1y1, "\
+ "'$OWDLOG' using 1:3 with lines title 'min owd'"\
+ "axis x1y1 "\
+ >> $GP
+ fi
+ echo >> $GP
+ cat $GP | gnuplot &
+ done
+done
+
+wait
+cd ..
+echo DONE
%RCVD = ();
%DSENT = ();
%DRCVD = ();
+%CWNDLOG = ();
+%RTTLOG = ();
+%OWDLOG = ();
$SENTB = 0;
$RCVDB = 0;
close SRV;
while (<>) {
- /([\d\_]+) (#\d+) (\S+) (.*)/ or next;
+ /(\d+_\d+_\d+_\d+_\d+) (#\d+) (\S+) (.*)/ or next;
my $time = $1;
my $channel = $2;
my $event = $3;
my $rest = $4;
my $host = $CHANN{"$channel"};
$host = "unknown" if not $host;
+ $time =~ /^(\d+)_(\d+)_(\d+)_(\d+)/;
+ my $ms=$1*60; $ms=($ms+$2)*60; $ms=($ms+$3)*1000; $ms+=$4;
if ($event eq "sent") {
$rest =~ /(\d+)b ([\d\.]+):/;
$ip = $2;
$DRCVD{$host}++;
$RCVD{$host} += $1;
$RCVDB += $1;
+ } elsif ($event eq "sendctrl") {
+ if ($rest =~ /cwnd (\d+\.\d+).*data_out (\d+)/) {
+ if (not exists $CWNDLOG{$host}) {
+ open(my $handle, '>', "harvest/$SERVER-$host-cwnd.log") or die;
+ $CWNDLOG{$host} = $handle;
+ }
+ print {$CWNDLOG{$host}} "$ms\t$1\t$2\n";
+ } elsif ($rest =~ /ledbat (\-?\d+)\-(\-?\d+)/) {
+ if (not exists $OWDLOG{$host}) {
+ open(my $handle, '>', "harvest/$SERVER-$host-owd.log") or die;
+ $OWDLOG{$host} = $handle;
+ }
+ print {$OWDLOG{$host}} "$ms\t$1\t$2\n";
+ } elsif ($rest =~ /rtt (\d+) dev (\d+)/) {
+ if (not exists $RTTLOG{$host}) {
+ open(my $handle, '>', "harvest/$SERVER-$host-rtt.log") or die;
+ $RTTLOG{$host} = $handle;
+ }
+ print {$RTTLOG{$host}} "$ms\t$1\t$2\n";
+ }
}
$EVENTS{"$host"} = { "+hs"=>0 } if not exists $EVENTS{"$host"};
}
+for $host (keys %CWNDLOG) {
+ close($CWNDLOG{$host});
+}
+for $host (keys %OWDLOG) {
+ close ($OWDLOG{$host});
+}
+for $host (keys %RTTLOG) {
+ close ($RTTLOG{$host});
+}
+open(LEGEND,"> harvest/$SERVER-legend.txt") or die;
+
for $channel (keys %CHANN) {
my $host = $CHANN{"$channel"};
+ print LEGEND "$channel\t$host\n";
open(STATS,"> harvest/$SERVER-$host.stat") or die;
my %events = %{ $EVENTS{"$host"} };
for $event ( keys %events ) {
$events{"Rdata"}, $events{"Tdata"},
$events{"Rdata"}+$events{"Tdata"}, $losses;
+ printf HTML
+ "<tr><td colspan='3'><a href='harvest/%s-%s.png'>".
+ "cwnd/data_out/rtt/owd graph</a></td></tr>\n",
+ $SERVER, $host;
+
print HTML "</table>\n";
close HTML;
}
+close LEGEND;
#!/bin/bash
+./loggraphs &
+
echo '<html><head>'
echo '<link rel="stylesheet" href="report.css" type="text/css">'
echo '</head><body>'
echo '</tr>'
done
echo '<body></html>'
+
+wait