2727
2828source " ${UTILS_DIR} /update-java-version.sh" 17
2929
30- for app in * ; do
31- if [[ ! -d " ${app} " ]]; then
32- continue
33- fi
34-
30+ run_app_benchmark () {
31+ local app=$1
32+
3533 message " ${type} benchmark: ${app} started"
3634
3735 export OUTPUT_DIR=" ${REPORTS_DIR} /${type} /${app} "
@@ -44,9 +42,15 @@ for app in *; do
4442 if [ " ${app} " == " petclinic" ]; then
4543 HEALTHCHECK_URL=http://localhost:8082
4644 REPETITIONS_COUNT=5
45+ PORT_START=8080
46+ PORT_END=8085
47+ HEALTHCHECK_PATH=" "
4748 elif [ " ${app} " == " insecure-bank" ]; then
48- HEALTHCHECK_URL=http://localhost:8082 /login
49+ HEALTHCHECK_URL=http://localhost:8088 /login
4950 REPETITIONS_COUNT=5
51+ PORT_START=8086
52+ PORT_END=8091
53+ HEALTHCHECK_PATH=" /login"
5054 else
5155 echo " Unknown app ${app} "
5256 exit 1
@@ -56,15 +60,9 @@ for app in *; do
5660 bash -c " ${UTILS_DIR} /../${type} /${app} /start-servers.sh" &
5761
5862 echo " Waiting for serves to start..."
59- if [ " ${app} " == " petclinic" ]; then
60- for port in $( seq 8080 8085) ; do
61- healthcheck http://localhost:$port
62- done
63- elif [ " ${app} " == " insecure-bank" ]; then
64- for port in $( seq 8080 8085) ; do
65- healthcheck http://localhost:$port /login
66- done
67- fi
63+ for port in $( seq $PORT_START $PORT_END ) ; do
64+ healthcheck http://localhost:$port$HEALTHCHECK_PATH
65+ done
6866 echo " Servers are up!"
6967
7068 (
@@ -74,4 +72,15 @@ for app in *; do
7472 done
7573
7674 message " ${type} benchmark: ${app} finished"
75+ }
76+
77+ # Run petclinic and insecure-bank benchmarks in parallel to reduce total runtime
78+ for app in * ; do
79+ if [[ ! -d " ${app} " ]]; then
80+ continue
81+ fi
82+ run_app_benchmark " ${app} " &
7783done
84+
85+ # Wait for all background jobs to complete
86+ wait
0 commit comments