Skip to content

Commit

Permalink
Update runner.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
harshita19244 authored Sep 8, 2021
1 parent 086531f commit 9a0a7c9
Showing 1 changed file with 12 additions and 54 deletions.
66 changes: 12 additions & 54 deletions runner/runner.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,20 @@ RESULTS_DIR=${RESULTS_DIR:-/results}
export JAVA_HOME=/usr/lib/jvm/jre-openjdk

echo "🏃 Starting Jaeger"
/tmp/jaeger-1.25.0-linux-amd64/jaeger-all-in-one --memory.max-traces 1_000_000 >"${RESULTS_DIR}/jaeger-${test}.log" 2>&1 &
pid=$!
/tmp/jaeger-1.25.0-linux-amd64/jaeger-all-in-one --memory.max-traces 10 >"${RESULTS_DIR}/jaeger-${test}.log" 2>&1 &pid=$!
if [ $? != 0 ]; then
echo "🛑 Failed to start Jaeger"
exit 1
fi

for test in spring-boot simple-java spring-cloud; do
echo "🏃 Starting Collector"
/tmp/opentelemetry-collector-0.34.0-linux-amd64/otel-col --config ./tmp/otel-config.yaml >"${RESULTS_DIR}/otlp-${test}.log" 2>&1 &pid2=$!
if [ $? != 0 ]; then
echo "🛑 Failed to start Collector"
exit 1
fi

for test in simple-java; do
cd "${WORK_DIR}/opentelemetry-benchmark-${test}"
if [ $? != 0 ]; then
echo "🛑 Failed to find the location for the test '${test}'"
Expand Down Expand Up @@ -47,55 +53,6 @@ for test in spring-boot simple-java spring-cloud; do
echo "${test} - Done!"
done

for test in jdbc jaxrs java-servlet-filter; do
cd "${WORK_DIR}/opentelemetry-benchmark-${test}"
if [ $? != 0 ]; then
echo "🛑 Failed to find the location for the test '${test}'"
continue
fi

echo "🩹 ${test} - Manually patching pom.xml to build with Java 11"
sed 's/<javac.target>14/<javac.target>11/gi' -i pom.xml
if [ $? != 0 ]; then
echo "🛑 Failed to patch the test '${test}'"
continue
fi

echo "⚒️ ${test} - Building"
mvn clean install -l "${RESULTS_DIR}/build-${test}.log"
if [ $? != 0 ]; then
echo "🛑 Failed to build the test '${test}'"
continue
fi

echo "🏃 Running ${test}"
java -javaagent:"${AUTO_AGENT}" \
-Dotel.resource.attributes=service.name="benchmark" \
-Dotel.traces.exporter=jaeger -Dotel.metrics.exporter=jaeger \
-Dotel.exporter.jaeger.endpoint=http://localhost:14250/ \
-jar target/benchmarks.jar >"${RESULTS_DIR}/benchmark-${test}-jaeger.log" 2>&1

java -javaagent:"${AUTO_AGENT}" \
-Dotel.resource.attributes=service.name="benchmark" \
-Dotel.traces.exporter=otlp \
-Dotel.metrics.exporter=otlp \
-Dotel.exporter.jaeger.endpoint=http://localhost:4317/ \
-jar target/benchmarks.jar >"${RESULTS_DIR}/benchmark-${test}-otlp.log" 2>&1

java -javaagent:"${AUTO_AGENT}" \
-Dotel.resource.attributes=service.name="benchmark" \
-Dotel.metrics.exporter=none \
-jar target/benchmarks.jar >"${RESULTS_DIR}/benchmark-${test}-notracer.log" 2>&1

if [ $? != 0 ]; then
echo "🛑 Failed to run the test '${test}'. Skipping next iterations."
break
fi
echo "✔️ ${test} done. Waiting about 1 minute for the machine to settle down."
sleep 1m

echo "${test} - Done!"
done

echo "🎣 Retrieving Jaeger metrics"
curl -so "${RESULTS_DIR}/jaeger-metrics.log" http://localhost:14269/metrics
Expand All @@ -105,5 +62,6 @@ if [ $? != 0 ]; then
fi

echo "🏃 Stopping Jaeger"
kill "${pid}"
wait ${pid}
kill -9 ${pid}
echo "🏃 Stopping Collector"
kill -9 ${pid2}

0 comments on commit 9a0a7c9

Please sign in to comment.