Merge branch 'master' of git://github.com/gritzko/swift
authorVictor Grishchenko (mughal) <victor.grishchenko@gmail.com>
Wed, 17 Feb 2010 13:27:16 +0000 (14:27 +0100)
committerVictor Grishchenko (mughal) <victor.grishchenko@gmail.com>
Wed, 17 Feb 2010 13:27:16 +0000 (14:27 +0100)
Conflicts:
sendrecv.cpp

exec/leecher.cpp
mfold/dohrv
mfold/env.default.sh
mfold/loggraphs
mfold/logparse
mfold/logreport
sendrecv.cpp

index b471188..3a2b65f 100644 (file)
@@ -43,7 +43,10 @@ int main (int argn, char** args) {
     else
         bindaddr = Address((uint32_t)INADDR_ANY,rand()%10000+7000);
 
-    assert(0<swift::Listen(bindaddr));
+    if (swift::Listen(bindaddr)<=0) {
+        fprintf(stderr,"Cannot listen on %s\n",bindaddr.str());
+        return -3;
+    }
 
        swift::SetTracker(tracker);
 
index 90afc06..ec170fb 100755 (executable)
@@ -5,7 +5,7 @@
 #   the result is put into harvest/
 #
 if [ ! $SERVERS ]; then
-    SERVERS="servers.txt"
+    export SERVERS="servers.txt"
 fi
 
 rm -rf harvest
@@ -29,7 +29,9 @@ done
 # batch-size is critical for performance
 LC_ALL=C sort -m -s --batch-size=64 harvest/*.fifo | gzip > harvest/swarm.log.gz &
 wait
-./logreport > report.html
+./logreport > harvest/index.html
+
 rm harvest/*.fifo
+cp report.css harvest
 
 echo DONE
index b73b0a0..c402dce 100644 (file)
@@ -3,5 +3,5 @@
 export SEEDER=130.161.211.198
 export SEEDPORT=10004
 export RUNPORT=10008
-export BRANCH=swiftapp
+export BRANCH=master
 export ORIGIN=git://github.com/gritzko/swift.git
index fbe0987..222beea 100755 (executable)
@@ -40,14 +40,15 @@ for from in `grep -v '^#' ../$SERVERS`; do
             echo -ne ", '$OWDLOG' using 1:2 with lines title 'owd' "\
                 "axis x1y1, "\
                 "'$OWDLOG' using 1:3 with lines title 'min owd'"\
+                "axis x1y1, "\
+                "'$OWDLOG' using 1:($2+25000) with lines title 'target'"\
                 "axis x1y1 "\
                 >> $GP
         fi
         echo >> $GP
-        cat $GP | gnuplot &
+        ( cat $GP | gnuplot ) &
     done
 done
 
 wait
 cd ..
-echo DONE
index 3ef9efd..e1fbcb7 100755 (executable)
@@ -135,11 +135,6 @@ for $channel (keys %CHANN) {
         $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;
 }
index ed6e639..bafe4c3 100755 (executable)
@@ -1,24 +1,31 @@
 #!/bin/bash
 
-./loggraphs &
+./loggraphs
+
+cd harvest
 
 echo '<html><head>'
 echo '<link rel="stylesheet" href="report.css" type="text/css">'
+echo '<title>Manifold: swarm tomography</title>'
 echo '</head><body>'
 echo '<table id="main"><th>'
-for to in `grep -v '#' servers.txt`; do
+for to in `grep -v '#' ../$SERVERS`; do
     echo '<td class="host">&gt;'$to'</td>'
 done
 echo '</th>'
-for from in `grep -v '#' servers.txt`; do
+for from in `grep -v '#' ../$SERVERS`; do
     echo '<tr><td class="host">'$from'&gt;</td>'
-    for to in `grep -v '#' servers.txt`; do
+    for to in `grep -v '#' ../$SERVERS`; do
         echo '<td>'
-        cat harvest/$from-$to.html
+        cat $from-$to.html
+        PNG="$from-$to.png"
+        if [ -e $PNG ]; then 
+            echo "<a href='$PNG'>"
+            echo "<img class='thumb' src='$PNG'/>"
+            echo "</a>"
+        fi
         echo '</td>'
     done
     echo '</tr>'
 done
 echo '<body></html>'
-
-wait
index 9f74a2a..71180d9 100644 (file)
@@ -183,7 +183,8 @@ bin64_t        Channel::AddData (Datagram& dgram) {
         return bin64_t::NONE;
     
     bin64_t tosend = bin64_t::NONE;
-    if (data_out_.size()<cwnd_ && last_data_out_time_<=NOW-send_interval_) {
+    tint luft = send_interval_>>2; // may wake up a bit earlier
+    if (data_out_.size()<cwnd_ && last_data_out_time_+send_interval_+luft<=NOW) {
         tosend = DequeueHint();
         if (tosend==bin64_t::NONE) {
             dprintf("%s #%u sendctrl no idea what to send\n",tintstr(),id_);
@@ -191,7 +192,8 @@ bin64_t        Channel::AddData (Datagram& dgram) {
                 SwitchSendControl(KEEP_ALIVE_CONTROL);
         }
     } else
-        dprintf("%s #%u sendctrl no cwnd\n",tintstr(),id_);
+        dprintf("%s #%u sendctrl wait cwnd %f data_out %i next %s\n",
+                tintstr(),id_,cwnd_,data_out_.size(),tintstr(last_data_out_time_+NOW-send_interval_));
     
     if (tosend==bin64_t::NONE)// && (last_data_out_time_>NOW-TINT_SEC || data_out_.empty())) 
         return bin64_t::NONE; // once in a while, empty data is sent just to check rtt FIXED