Added per-peer per-channel event counts;
authorVictor Grishchenko (mughal) <victor.grishchenko@gmail.com>
Thu, 11 Feb 2010 16:57:30 +0000 (17:57 +0100)
committerVictor Grishchenko (mughal) <victor.grishchenko@gmail.com>
Thu, 11 Feb 2010 16:57:30 +0000 (17:57 +0100)
all stats will be based on that counts.

mfold/clean.default.sh
mfold/docmd
mfold/dohrv
mfold/env.default.sh
mfold/logparse
mfold/swlognm [deleted file]

index 6361b08..5ea4fa8 100644 (file)
@@ -2,4 +2,8 @@ cd swift
 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
index ee6fcdb..3db38a9 100755 (executable)
@@ -4,10 +4,6 @@ HOST=$1
 CMD=$2
 ENV=env.default.sh
 
-if [ ! $SERVERS ]; then
-    SERVERS="servers.txt"
-fi
-
 if [ -e $CMD.$HOST.sh ] ; then 
     SHSC=$CMD.$HOST.sh ;
 else 
index 698dad4..dd05439 100755 (executable)
@@ -11,14 +11,14 @@ fi
 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
@@ -27,8 +27,8 @@ done
 
 # 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
index 2fb63a4..c358977 100644 (file)
@@ -1,5 +1,5 @@
 # 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
index 948448d..21f9911 100755 (executable)
@@ -2,8 +2,8 @@
 
 $SERVER=shift;
 %HOSTS = ();
-%CHANN = ();
-$CHANN{"#0"} = "none";
+%CHANN = ( "#0" => "none" );
+%EVENTS = ( "#0" => {"+hs"=>0} );
 
 open(SRV,$ENV{"HOME"}."/.ssh/config") or die;
 while (<SRV>) {
@@ -22,8 +22,24 @@ while (<>) {
         $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;
 }
diff --git a/mfold/swlognm b/mfold/swlognm
deleted file mode 100755 (executable)
index da42a29..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-#!/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;
-}