diff options
author | Bart Polot <bart@net.in.tum.de> | 2014-03-21 18:44:34 +0000 |
---|---|---|
committer | Bart Polot <bart@net.in.tum.de> | 2014-03-21 18:44:34 +0000 |
commit | 273044e2abef1eeebcc07165f9148fd6ea7f4192 (patch) | |
tree | 3a8102a79585417df485d2503a9cce90a1579eff | |
parent | 4fa9e976857ac1bc0206bf9a801343edac644d17 (diff) | |
download | gnunet-273044e2abef1eeebcc07165f9148fd6ea7f4192.tar.gz gnunet-273044e2abef1eeebcc07165f9148fd6ea7f4192.zip |
- wrap profiler in script to alter config file
-rw-r--r-- | src/mesh/profiler.template (renamed from src/mesh/profiler.conf) | 0 | ||||
-rwxr-xr-x | src/mesh/run_profiler.sh | 21 |
2 files changed, 21 insertions, 0 deletions
diff --git a/src/mesh/profiler.conf b/src/mesh/profiler.template index 4dec92431..4dec92431 100644 --- a/src/mesh/profiler.conf +++ b/src/mesh/profiler.template | |||
diff --git a/src/mesh/run_profiler.sh b/src/mesh/run_profiler.sh new file mode 100755 index 000000000..fe5dbbd14 --- /dev/null +++ b/src/mesh/run_profiler.sh | |||
@@ -0,0 +1,21 @@ | |||
1 | #!/bin/sh | ||
2 | |||
3 | if [ "$#" -lt "1" ]; then | ||
4 | echo "usage: $0 PEERS"; | ||
5 | exit 1; | ||
6 | fi | ||
7 | |||
8 | PEERS=$1 | ||
9 | |||
10 | if [ $PEERS -eq 1 ]; then | ||
11 | echo "cannot run 1 peer"; | ||
12 | exit 1; | ||
13 | fi | ||
14 | |||
15 | LINKS=`echo "l($PEERS) * $PEERS" | bc -l` | ||
16 | LINKS=`printf "%.0f" $LINKS` | ||
17 | echo "using $PEERS peers, $LINKS links"; | ||
18 | |||
19 | sed -e "s/%LINKS%/$LINKS/g" profiler.template > profiler.conf | ||
20 | |||
21 | ./gnunet-mesh-profiler $PEERS | ||