-
Notifications
You must be signed in to change notification settings - Fork 84
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Create separate test/benchmarks folder
* Update the `jmh.sh` script and create a `test-run.sh` script. * Update the `DataReplicationBenchmark` to point to something other than a tmpfs. * Move the existing benchmarks.
- Loading branch information
Showing
10 changed files
with
149 additions
and
191 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,28 @@ | ||
#!/bin/bash | ||
|
||
BASEDIR=$(dirname $0) | ||
ROOTDIR=$(realpath ${BASEDIR}/..) | ||
LIBS="${ROOTDIR}/target/libs" | ||
CLASSES="${ROOTDIR}/target/classes" | ||
TEST_CLASSES="${ROOTDIR}/target/test-classes" | ||
CONFDIR="${ROOTDIR}/conf" | ||
BASEDIR=$(dirname "$0") | ||
|
||
function help() { | ||
echo "$@" | ||
echo "" | ||
echo "tip: run '$0 -h' for JMH options" | ||
echo "tip: pass '-h' for JMH options" | ||
exit 1 | ||
} | ||
|
||
function check_if_exists_or_exit() { | ||
[ ! -d "$@" ] && help "Missing '$@' directory. Run: 'mvn clean package -DskipTests' before running the JMH benchmark" | ||
function list_benchmarks() { | ||
echo "Available benchmarks:" | ||
printf "\tDataReplicationBenchmark\n" | ||
printf "\tLogJmhBenchmark\n" | ||
printf "\tStorageAppenderBenchmark\n" | ||
help; | ||
} | ||
|
||
check_if_exists_or_exit ${LIBS} | ||
check_if_exists_or_exit ${CLASSES} | ||
check_if_exists_or_exit ${TEST_CLASSES} | ||
BENCHMARK="$1" | ||
shift; | ||
|
||
java -cp "${LIBS}/*":${CLASSES}:${TEST_CLASSES}:${CONFDIR} ${JAVA_OPTIONS} org.openjdk.jmh.Main org.jgroups.perf.LogJmhBenchmark $@ | ||
if [ "$BENCHMARK" = "-list" ]; then | ||
list_benchmarks | ||
exit 0; | ||
fi | ||
|
||
# shellcheck disable=SC2086,SC2048 | ||
"$BASEDIR"/test-run.sh -ea org.openjdk.jmh.Main "$BENCHMARK" $* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
#!/bin/bash | ||
|
||
# Same as `run.sh` but for running classes in the test sources. | ||
|
||
function check_if_exists_or_exit() { | ||
[ ! -d "$@" ] && help "Missing '$@' directory. Run: 'mvn clean package -DskipTests' before running" | ||
} | ||
|
||
MCAST_ADDR=232.5.5.5 | ||
BIN_DIR=$(dirname "$0") | ||
|
||
# Project built with Maven. | ||
LIB=${BIN_DIR}/../target/libs | ||
CLASSES=${BIN_DIR}/../target/classes | ||
TEST_CLASSES=${BIN_DIR}/../target/test-classes | ||
CONF=${BIN_DIR}/../conf | ||
|
||
check_if_exists_or_exit ${LIBS} | ||
check_if_exists_or_exit ${CLASSES} | ||
check_if_exists_or_exit ${TEST_CLASSES} | ||
|
||
CP="$CLASSES:$CONF:$TEST_CLASSES:$LIB/*" | ||
LOG="-Dlog4j.configurationFile=log4j2.xml" | ||
|
||
JG_FLAGS="-Djgroups.udp.mcast_addr=$MCAST_ADDR" | ||
JG_FLAGS="$JG_FLAGS -Djava.net.preferIPv4Stack=true" | ||
|
||
FLAGS="-server -Xmx600M -Xms600M" | ||
FLAGS="$FLAGS -XX:CompileThreshold=10000 -XX:ThreadStackSize=64K -XX:SurvivorRatio=8" | ||
FLAGS="$FLAGS -XX:TargetSurvivorRatio=90 -XX:MaxTenuringThreshold=15" | ||
FLAGS="$FLAGS -Xshare:off" | ||
|
||
#GC="-XX:+UseParNewGC -XX:+UseConcMarkSweepGC" ## concurrent mark and sweep (CMS) collector | ||
|
||
EXPERIMENTAL="$EXPERIMENTAL -XX:+EliminateLocks" | ||
#DEBUG="-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=*:8787" | ||
|
||
# shellcheck disable=SC2086,SC2048 | ||
java -cp $CP $DEBUG $LOG $GC $JG_FLAGS $FLAGS $EXPERIMENTAL $JAVA_OPTIONS $* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.