diff --git a/README.md b/README.md index 743c654..6dd438e 100644 --- a/README.md +++ b/README.md @@ -8,8 +8,17 @@ This project contains the following modules: - A Quarkus 3.x version of the application - [quarkus3-spring-compatibility](quarkus3-spring-compatibility) - A Quarkus 3.x version of the application using the Spring compatibility layer + +## Building + +`./mvnw clean verify -Dquarkus.hibernate-orm.sql-load-script=import.sql` ## Application requirements/dependencies + +- (macOS) You need to have a `timeout` compatible command: + - Via `coreutils` (installed via Homebrew): `brew install coreutils` but note that this will install lots of GNU utils that will duplicate native commands and prefix them with `g` (e.g. `gdate`) + - Use [this implementation](https://github.com/aisk/timeout) via Homebrew: `brew install aisk/homebrew-tap/timeout` + - More options at https://stackoverflow.com/questions/3504945/timeout-command-on-mac-os-x - Base JVM Version: 21 diff --git a/scripts/1strequest.sh b/scripts/1strequest.sh index 265bb29..e01fd66 100755 --- a/scripts/1strequest.sh +++ b/scripts/1strequest.sh @@ -18,6 +18,14 @@ NUM_ITERATIONS=1 TOTAL_RSS=0 TOTAL_TTFR=0 +function _date() { + current=$(date +%s%N) + if [ $? -ne 0 ]; then + current=$(gdate +%s%N) + fi + echo "$current" +} + if [ "$#" -eq 2 ]; then NUM_ITERATIONS=$2 fi @@ -30,7 +38,7 @@ do # Start the infra ./infra.sh -s - ts=$(gdate +%s%N) + ts=$(_date) $COMMAND & CURRENT_PID=$! @@ -40,7 +48,7 @@ do : done - TTFR=$((($(gdate +%s%N) - $ts)/1000000)) + TTFR=$((($(_date) - ts)/1000000)) RSS=`ps -o rss= -p $CURRENT_PID | sed 's/^ *//g'` kill $CURRENT_PID wait $CURRENT_PID 2> /dev/null @@ -62,4 +70,4 @@ echo echo "-------------------------------------------------" printf "AVG RSS (after 1st request): %.1f MB\n" $(echo "$TOTAL_RSS / $NUM_ITERATIONS / 1024" | bc -l) printf "AVG time to first request: %.3f sec\n" $(echo "$TOTAL_TTFR / $NUM_ITERATIONS / 1000" | bc -l) -echo "-------------------------------------------------" \ No newline at end of file +echo "-------------------------------------------------"