diff --git a/env.sh b/env.sh index 45179d8..62c56cb 100644 --- a/env.sh +++ b/env.sh @@ -1,8 +1,8 @@ # make sure all child processes are killed -trap "trap - SIGTERM && kill -- -$$" SIGINT SIGTERM EXIT +trap "pkill -P $$" SIGINT SIGTERM EXIT # get testing home directory from finding absolute path of env.sh -DIR="$(dirname $0)" +DIR=$(dirname $0) TEST_HOME=$(cd "$(dirname $BASH_SOURCE)"; pwd) # test config variables @@ -28,15 +28,15 @@ TEST_HOME=$(cd "$(dirname $BASH_SOURCE)"; pwd) collect() { if [ -f "$OUTCONFIG" ]; then - $COLLECTBEAT -c <(cat "$DIR/collect.yml" "$OUTCONFIG") + $COLLECTBEAT -c <(cat "$DIR/collect.yml" "$OUTCONFIG") & else - $COLLECTBEAT -c <(cat $DIR/collect.yml <(echo "output.console:")) > $OUTDIR/stats.json + $COLLECTBEAT -c <(cat $DIR/collect.yml <(echo "output.console:")) > $OUTDIR/stats.json & fi } watch() { if $ENABLE_WATCH && [ -f "$EXPVAR_RATES" ]; then - python $EXPVAR_RATES $1/debug/vars + python $EXPVAR_RATES $1/debug/vars & fi } diff --git a/genbeat_logstash/compressed/collect.yml b/genbeat_logstash/compressed/collect.yml index 165b9f0..141e56c 100644 --- a/genbeat_logstash/compressed/collect.yml +++ b/genbeat_logstash/compressed/collect.yml @@ -5,7 +5,7 @@ metricbeat.modules: period: 1s processes: - generatorbeat - - tst-lj + - java - module: beats metricsets: diff --git a/genbeat_logstash/compressed/run.sh b/genbeat_logstash/compressed/run.sh index bdb17c6..272bd5e 100755 --- a/genbeat_logstash/compressed/run.sh +++ b/genbeat_logstash/compressed/run.sh @@ -3,15 +3,14 @@ source $(dirname $0)/../../env.sh ## start logstash test server -$LOGSTASH -f logstash.conf >/dev/null 2>&1 & +$LOGSTASH -f $DIR/logstash.conf >/dev/null 2>&1 & # start generatorbeat sending events to test server $GENERATORBEAT -httpprof localhost:6060 -c $DIR/genbeat.yml & -watch http://localhost:6060 & +watch http://localhost:6060 -# start metrics collection sleep 5 -collect & +collect wait_shut $1 diff --git a/genbeat_tstlj_es/run.sh b/genbeat_tstlj_es/run.sh index 4c3fe6f..fabb40d 100755 --- a/genbeat_tstlj_es/run.sh +++ b/genbeat_tstlj_es/run.sh @@ -8,9 +8,8 @@ $TST_LJ -es -bind localhost:9200 >/dev/null 2>&1 & # start generatorbeat sending events to test server $GENERATORBEAT -httpprof localhost:6060 -c $DIR/genbeat.yml & -watch http://localhost:6060 & +watch http://localhost:6060 -# start metrics collection -collect & +collect wait_shut $1 diff --git a/genbeat_tstlj_v2/compressed/run.sh b/genbeat_tstlj_v2/compressed/run.sh index b8f3f37..a3de10e 100755 --- a/genbeat_tstlj_v2/compressed/run.sh +++ b/genbeat_tstlj_v2/compressed/run.sh @@ -8,8 +8,8 @@ $TST_LJ -v2 -bind localhost:5044 >/dev/null 2>&1 & # start generatorbeat sending events to test server $GENERATORBEAT -httpprof localhost:6060 -c $DIR/genbeat.yml & -watch http://localhost:6060 & +watch http://localhost:6060 -collect & +collect wait_shut $1 diff --git a/genbeat_tstlj_v2/compressed_pipelined/run.sh b/genbeat_tstlj_v2/compressed_pipelined/run.sh index b8f3f37..a3de10e 100755 --- a/genbeat_tstlj_v2/compressed_pipelined/run.sh +++ b/genbeat_tstlj_v2/compressed_pipelined/run.sh @@ -8,8 +8,8 @@ $TST_LJ -v2 -bind localhost:5044 >/dev/null 2>&1 & # start generatorbeat sending events to test server $GENERATORBEAT -httpprof localhost:6060 -c $DIR/genbeat.yml & -watch http://localhost:6060 & +watch http://localhost:6060 -collect & +collect wait_shut $1 diff --git a/genbeat_tstlj_v2/uncompressed/run.sh b/genbeat_tstlj_v2/uncompressed/run.sh index b8f3f37..a3de10e 100755 --- a/genbeat_tstlj_v2/uncompressed/run.sh +++ b/genbeat_tstlj_v2/uncompressed/run.sh @@ -8,8 +8,8 @@ $TST_LJ -v2 -bind localhost:5044 >/dev/null 2>&1 & # start generatorbeat sending events to test server $GENERATORBEAT -httpprof localhost:6060 -c $DIR/genbeat.yml & -watch http://localhost:6060 & +watch http://localhost:6060 -collect & +collect wait_shut $1 diff --git a/genbeat_tstlj_v2/uncompressed_pipelined/run.sh b/genbeat_tstlj_v2/uncompressed_pipelined/run.sh index b8f3f37..a3de10e 100755 --- a/genbeat_tstlj_v2/uncompressed_pipelined/run.sh +++ b/genbeat_tstlj_v2/uncompressed_pipelined/run.sh @@ -8,8 +8,8 @@ $TST_LJ -v2 -bind localhost:5044 >/dev/null 2>&1 & # start generatorbeat sending events to test server $GENERATORBEAT -httpprof localhost:6060 -c $DIR/genbeat.yml & -watch http://localhost:6060 & +watch http://localhost:6060 -collect & +collect wait_shut $1 diff --git a/run.sh b/run.sh new file mode 100755 index 0000000..37425d0 --- /dev/null +++ b/run.sh @@ -0,0 +1,14 @@ +#!/usr/bin/env bash + +trap "trap - SIGTERM && kill -- -$$" SIGINT SIGTERM EXIT + +export DURATION=240 +export ENABLE_WATCH=false + +while true; do + #./genbeat_logstash/compressed/run.sh + #./genbeat_logstash/uncompressed_pipelined/run.sh + ./genbeat_tstlj_v2/compressed/run.sh + ./genbeat_tstlj_v2/compressed_pipelined/run.sh + #./genbeat_tstlj_es/run.sh +done