- start test only after warmup
[oweals/gnunet.git] / src / mesh / run_profiler.sh
index a202567f0f8b625a5eff5d8232fbaf2c99ef1a45..bd9f239a467d0083ac6016a3fd5422de619d8177 100755 (executable)
@@ -1,11 +1,14 @@
 #!/bin/sh
 
-if [ "$#" -lt "2" ]; then
-    echo "usage: $0 PEERS PINGING_PEERS";
+if [ "$#" -lt "3" ]; then
+    echo "usage: $0 ROUND_TIME PEERS PINGING_PEERS";
+    echo "example: $0 30s 16 1";
     exit 1;
 fi
 
-PEERS=$1
+ROUNDTIME=$1
+PEERS=$2
+PINGS=$3
 
 if [ $PEERS -eq 1 ]; then
     echo "cannot run 1 peer";
@@ -14,8 +17,9 @@ fi
 
 LINKS=`echo "l($PEERS) * $PEERS" | bc -l`
 LINKS=`printf "%.0f" $LINKS`
+NSE=`echo "l($PEERS)/l(10)" | bc -l`
 echo "using $PEERS peers, $LINKS links";
     
-sed -e "s/%LINKS%/$LINKS/g" profiler.conf > .profiler.conf
+sed -e "s/%LINKS%/$LINKS/;s/%NSE%/$NSE/" profiler.conf > .profiler.conf
 
-./gnunet-mesh-profiler $PEERS $2 |& tee log
+./gnunet-mesh-profiler $ROUNDTIME $PEERS $PINGS |& tee log | grep -v DEBUG