aboutsummaryrefslogtreecommitdiff
path: root/src/cadet/run_profiler.sh
diff options
context:
space:
mode:
Diffstat (limited to 'src/cadet/run_profiler.sh')
-rwxr-xr-xsrc/cadet/run_profiler.sh25
1 files changed, 25 insertions, 0 deletions
diff --git a/src/cadet/run_profiler.sh b/src/cadet/run_profiler.sh
new file mode 100755
index 000000000..aba6ce4d4
--- /dev/null
+++ b/src/cadet/run_profiler.sh
@@ -0,0 +1,25 @@
1#!/bin/sh
2
3if [ "$#" -lt "3" ]; then
4 echo "usage: $0 ROUND_TIME PEERS PINGING_PEERS";
5 echo "example: $0 30s 16 1";
6 exit 1;
7fi
8
9ROUNDTIME=$1
10PEERS=$2
11PINGS=$3
12
13if [ $PEERS -eq 1 ]; then
14 echo "cannot run 1 peer";
15 exit 1;
16fi
17
18LINKS=`echo "l($PEERS)/l(2) * $PEERS" | bc -l`
19LINKS=`printf "%.0f" $LINKS`
20NSE=`echo "l($PEERS)/l(2)" | bc -l`
21echo "using $PEERS peers, $LINKS links";
22
23sed -e "s/%LINKS%/$LINKS/;s/%NSE%/$NSE/" profiler.conf > .profiler.conf
24
25./gnunet-mesh-profiler $ROUNDTIME $PEERS $PINGS $4 |& tee log | grep -v DEBUG