Browse Source

specify artifact

master
Jaryl Chng 1 year ago
parent
commit
6639696bc4
2 changed files with 56 additions and 1 deletions
  1. +1
    -1
      .gitlab-ci.yml
  2. +55
    -0
      benchmark-wrk.sh

+ 1
- 1
.gitlab-ci.yml View File

@ -21,4 +21,4 @@ build:
artifacts:
paths:
- "*.jar"
- "*.sh"
- "benchmark-wrk.sh"

+ 55
- 0
benchmark-wrk.sh View File

@ -0,0 +1,55 @@
#!/usr/bin/env bash
trap 'kill -TERM $PID; exit' SIGINT
usage() {
echo "$0 <duration> <threads> <connections>"
}
if [[ -z "$1" ]]; then
usage
exit 1
fi
if [[ -z "$2" ]]; then
usage
exit 2
fi
if [[ -z "$3" ]]; then
usage
exit 3
fi
BASEDIR=$(dirname "$0")
for file in "${BASEDIR}"/*.jar ; do
echo "BENCHMARKING ${file/${BASEDIR}\//}"
echo " ASYNC"
${file} &> /dev/null &
PID=$!
DONE=0
while [[ $DONE -eq 0 ]]; do
if curl -s http://localhost:8080/ > /dev/null; then
sleep 1
wrk -d"$1" -t"$2" -c"$3" http://localhost:8080/async/benchmark/benchmarker/01189998819991197253
DONE=1
fi
sleep 1
done
kill -TERM $PID
wait
echo " SYNC"
${file} &> /dev/null &
PID=$!
DONE=0
while [[ $DONE -eq 0 ]]; do
if curl -s http://localhost:8080/ > /dev/null; then
sleep 1
wrk -d"$1" -t"$2" -c"$3" http://localhost:8080/sync/benchmark/benchmarker/01189998819991197253
DONE=1
fi
sleep 1
done
kill -TERM $PID
wait
echo ""
done

Loading…
Cancel
Save