Skip to content

Commit

Permalink
Run perf stat against the load generator
Browse files Browse the repository at this point in the history
  • Loading branch information
lampajr authored and franz1981 committed Oct 2, 2024
1 parent e778632 commit ebc73c1
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions scripts/benchmark.sh
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ Help()
echo " default is false"
}

while getopts "hu::e::f::d::jt::r::c:p:w" option; do
while getopts "hu:e:f:d:jt:r:c:pw" option; do
case $option in
h) Help
exit;;
Expand Down Expand Up @@ -166,6 +166,11 @@ fi
ap_pid=$!

if [ "${PERF}" = true ]; then
if [ "${WRK_PROFILING}" = true ]; then
echo "----- Collecting perf stat on $wrk_jvm_pid"
perf stat -d -p "$wrk_jvm_pid" &
wrk_stat_pid=$!
fi
echo "----- Collecting perf stat on $quarkus_pid"
perf stat -d -p $quarkus_pid &
stat_pid=$!
Expand All @@ -177,7 +182,7 @@ if [[ "$OSTYPE" == "linux-gnu" ]]; then
pidstat -p $quarkus_pid 1 &
pidstat_pid=$!
sleep $WARMUP
kill -SIGTERM $pidstat_pid
kill -SIGTERM "$pidstat_pid"
else
# Print stats header
ps -p $quarkus_pid -o %cpu,rss,vsz | head -1
Expand All @@ -191,7 +196,10 @@ echo "----- Stopped stats, waiting load to complete"
wait $ap_pid

if [ "${PERF}" = true ]; then
kill -SIGINT $stat_pid
if [ "${WRK_PROFILING}" = true ]; then
kill -SIGINT "$wrk_stat_pid"
fi
kill -SIGINT "$stat_pid"
fi

wait $wrk_pid
Expand Down

0 comments on commit ebc73c1

Please sign in to comment.