From 273044e2abef1eeebcc07165f9148fd6ea7f4192 Mon Sep 17 00:00:00 2001 From: Bart Polot Date: Fri, 21 Mar 2014 18:44:34 +0000 Subject: - wrap profiler in script to alter config file --- src/mesh/profiler.conf | 8 -------- src/mesh/profiler.template | 8 ++++++++ src/mesh/run_profiler.sh | 21 +++++++++++++++++++++ 3 files changed, 29 insertions(+), 8 deletions(-) delete mode 100644 src/mesh/profiler.conf create mode 100644 src/mesh/profiler.template create mode 100755 src/mesh/run_profiler.sh diff --git a/src/mesh/profiler.conf b/src/mesh/profiler.conf deleted file mode 100644 index 4dec92431..000000000 --- a/src/mesh/profiler.conf +++ /dev/null @@ -1,8 +0,0 @@ -@INLINE@ test_mesh.conf -[testbed] -OVERLAY_TOPOLOGY = RANDOM -OVERLAY_RANDOM_LINKS = 200 - -[transport] -#MANIPULATE_DELAY_IN = 50 ms -MANIPULATE_DELAY_OUT = 100 ms \ No newline at end of file diff --git a/src/mesh/profiler.template b/src/mesh/profiler.template new file mode 100644 index 000000000..4dec92431 --- /dev/null +++ b/src/mesh/profiler.template @@ -0,0 +1,8 @@ +@INLINE@ test_mesh.conf +[testbed] +OVERLAY_TOPOLOGY = RANDOM +OVERLAY_RANDOM_LINKS = 200 + +[transport] +#MANIPULATE_DELAY_IN = 50 ms +MANIPULATE_DELAY_OUT = 100 ms \ No newline at end of file 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 @@ +#!/bin/sh + +if [ "$#" -lt "1" ]; then + echo "usage: $0 PEERS"; + exit 1; +fi + +PEERS=$1 + +if [ $PEERS -eq 1 ]; then + echo "cannot run 1 peer"; + exit 1; +fi + +LINKS=`echo "l($PEERS) * $PEERS" | bc -l` +LINKS=`printf "%.0f" $LINKS` +echo "using $PEERS peers, $LINKS links"; + +sed -e "s/%LINKS%/$LINKS/g" profiler.template > profiler.conf + +./gnunet-mesh-profiler $PEERS -- cgit v1.2.3