improve stress test outputs
[src/app-framework-binder.git] / stress-server.sh
1 #!/bin/bash
2
3 ROOT=$(dirname $0)
4 echo ROOT=$ROOT
5
6 cd $ROOT
7 pwd
8
9 AFB=build/src/afb-daemon
10 HELLO=build/bindings/samples/helloWorld.so
11 PORT=12345
12 TEST=test
13 TOKEN=knock-knock-knock
14 OUT=stress-out-server
15
16 rm $OUT*
17
18 case "$1" in
19  --ws)
20   shift
21   ARGS="-q --ldpaths=/tmp --binding=$HELLO --session-max=100 --ws-server=unix:hello --no-httpd --exec $AFB --session-max=100 --port=$PORT --ldpaths=/tmp --roothttp=$TEST --token=$TOKEN --ws-client=unix:hello "
22 #  ARGS="-vv --tracereq=all --ldpaths=/tmp --binding=$HELLO --session-max=100 --ws-server=unix:hello --no-httpd --exec $AFB --session-max=100 --port=$PORT --ldpaths=/tmp --roothttp=$TEST --token=$TOKEN --ws-client=unix:hello "
23   ;;
24  *)
25   ARGS="-q --session-max=100 --port=$PORT --workdir=$ROOT --roothttp=$TEST --token=$TOKEN --ldpaths=/tmp --binding=$HELLO"
26   ;;
27 esac
28
29
30 echo $AFB $ARGS $@
31 echo -n launch afb...
32 case "$1" in
33  gdb) shift; gdb $AFB -ex "run $ARGS $@";;
34  valgrind) shift; valgrind --leak-check=full $AFB $ARGS $@ 2>&1 | tee $OUT;;
35  strace) shift; strace -tt -f -o $OUT.strace $AFB $ARGS $@ 2>&1 | tee $OUT;;
36  *) $AFB $ARGS $@ 2>&1 | tee $OUT;;
37 esac
38 #$AFB -q --session-max=100 --port=$PORT --workdir=$ROOT --roothttp=$TEST --token=$TOKEN --ldpaths=/tmp --binding=$HELLO  > $OUT.0 2>&1 &
39 #afbpid=$!
40 #strace -tt -f -o $OUT-strace.0 -p $afbpid &
41 wait