all stats will be based on that counts.
rm -f chunk core lout lerr
killall leecher
killall seeder
+if [ -e .netem-iface ]; then
+ sudo tc qdisc del dev `cat .netem-iface` root
+ rm .netem-iface
+fi
echo DONE
CMD=$2
ENV=env.default.sh
-if [ ! $SERVERS ]; then
- SERVERS="servers.txt"
-fi
-
if [ -e $CMD.$HOST.sh ] ; then
SHSC=$CMD.$HOST.sh ;
else
rm -rf harvest
mkdir harvest
-for s in `cat $SERVERS`; do
- mkfifo harvest/$s.log
+for s in `grep -v '#' $SERVERS`; do
+ mkfifo harvest/$s.fifo
done
-for s in `cat $SERVERS`; do
+for s in `grep -v '#' $SERVERS`; do
(if ssh $s "cat ./swift/lout.gz" | gunzip | \
./logparse $s \
- > harvest/$s.log-fifo ; then
+ > harvest/$s.fifo ; then
echo $s harvest OK
else
echo $s harvest FAIL
# Ensure your version of sort is recent enough
# batch-size is critical for performance
-LC_ALL=C sort -m -s --batch-size=64 harvest/*.log-fifo | gzip > harvest/swarm.log.gz &
+LC_ALL=C sort -m -s --batch-size=64 harvest/*.fifo | gzip > harvest/swarm.log.gz &
wait
-rm harvest/*.log-fifo
+rm harvest/*.fifo
echo DONE
# This script sets up shared environment variables
# at the servers
-export SEEDER=130.161.211.198
+export SEEDER=#YOUR IP HERE#
export SEEDPORT=10001
export RUNPORT=10002
$SERVER=shift;
%HOSTS = ();
-%CHANN = ();
-$CHANN{"#0"} = "none";
+%CHANN = ( "#0" => "none" );
+%EVENTS = ( "#0" => {"+hs"=>0} );
open(SRV,$ENV{"HOME"}."/.ssh/config") or die;
while (<SRV>) {
$rest =~ /\d+b ([\d\.]+):/;
$ip = $1;
$CHANN{"$channel"} = $HOSTS{$ip};
+ $EVENTS{"$channel"} = { "+hs"=>0 } if not exists $EVENTS{"$channel"};
}
my $host = $CHANN{"$channel"};
$host = "unknown" if not $host;
+
print "$time $SERVER $host$channel $event $rest\n";
+
+ # DO STATS
+ $EVENTS{"$channel"}{"$event"} = 0 if not exists $EVENTS{"$channel"}{"$event"};
+ $EVENTS{"$channel"}{"$event"}++;
+
+}
+
+for $channel (keys %CHANN) {
+ my $host = $CHANN{"$channel"};
+ open(STATS,"> harvest/$SERVER-$host.stat") or die;
+ for $event ( keys %{ $EVENTS{"$channel"} } ) {
+ print STATS "$event\t".($EVENTS{"$channel"}{"$event"})."\n";
+ }
+ close STATS;
}
+++ /dev/null
-#!/usr/bin/perl -w
-
-#
-# This script detects handshake patterns
-# and changes channel numbers for host names
-#
-#0_05_01_981_298 node309 #45 +hs f33dff82
-#0_05_02_039_313 lossy #16 -hs f33dff82
-my %HSSRC = ();
-my %CH = ();
-
-while (<>) {
- / (\S+) (\#\d+)/ || next;
- my $src = $1;
- my $ch = $2;
- if ( exists $CH{"$src$ch"} ){
- s/$ch/$CH{"$src$ch"}$ch/ or die $_;
- } elsif (/[\+\-]hs ([a-f0-9]+)$/) {
- if ( exists $HSSRC{$1} ) {
- $CH{"$src$ch"} = $HSSRC{$1};
- my $srckey = $HSSRC{$1}.$HSSRCCH{$1};
- $CH{$srckey} = $src;
- } else {
- $HSSRC{$1} = $src;
- $HSSRCCH{$1} = $ch;
- }
- }
- print;
-}