diff --git a/benchmarks/install_and_test.sh b/benchmarks/install_and_test.sh index 41825d5f4e..b5e559626a 100755 --- a/benchmarks/install_and_test.sh +++ b/benchmarks/install_and_test.sh @@ -24,12 +24,14 @@ runAllBenchmarks=1 runPython=0 runNode=0 runCsharp=0 +runJava=0 runRust=0 concurrentTasks="1 10 100 1000" dataSize="100 4000" clientCount="1" chosenClients="all" host="localhost" +port=6379 tlsFlag="--tls" function runPythonBenchmark(){ @@ -68,6 +70,14 @@ function runCSharpBenchmark(){ dotnet run --configuration Release --resultsFile=../$1 --dataSize $2 --concurrentTasks $concurrentTasks --clients $chosenClients --host $host --clientCount $clientCount $tlsFlag } +function runJavaBenchmark(){ + cd ${BENCH_FOLDER}/../java + echo "./gradlew run --args=\"--resultsFile=${BENCH_FOLDER}/$1 --clients $chosenClients --host $host --port $port\"" +# ./gradlew run --args="--resultsFile=../$1 --dataSize $2 --concurrentTasks $concurrentTasks --clients $chosenClients --host $host --port $port --clientCount $clientCount $tlsFlag" + ./gradlew run --args="--resultsFile=${BENCH_FOLDER}/$1 --clients $chosenClients --host $host --port $port" + cd ${BENCH_FOLDER}/java +} + function runRustBenchmark(){ rustConcurrentTasks= for value in $concurrentTasks @@ -180,6 +190,21 @@ do runAllBenchmarks=0 runNode=1 ;; + -java) + runAllBenchmarks=0 + runJava=1 + chosenClients="Babushka" + ;; + -lettuce) + runAllBenchmarks=0 + runJava=1 + chosenClients="Lettuce" + ;; + -lettuce) + runAllBenchmarks=0 + runJava=1 + chosenClients="Jedis" + ;; -csharp) runAllBenchmarks=0 runCsharp=1 @@ -233,6 +258,13 @@ do runCSharpBenchmark $csharpResults $currentDataSize fi + if [ $runAllBenchmarks == 1 ] || [ $runJava == 1 ]; + then + javaResults=$(resultFileName java $currentDataSize) + resultFiles+=$javaResults" " + runJavaBenchmark $javaResults $currentDataSize + fi + if [ $runAllBenchmarks == 1 ] || [ $runRust == 1 ]; then rustResults=$(resultFileName rust $currentDataSize) @@ -241,8 +273,6 @@ do fi done - - flushDB if [ $writeResultsCSV == 1 ]; diff --git a/java/README.md b/java/README.md index a22fb4cf24..9f19374828 100644 --- a/java/README.md +++ b/java/README.md @@ -21,7 +21,7 @@ You can assemble the Java clients benchmarks by compiling using `./gradlew build You can run benchmarks using `./gradlew run`. You can set arguments using the args flag like: ```shell -./gradle run --args="--clients lettuce" +./gradlew run --args="--clients lettuce" ``` The following arguments are accepted: diff --git a/java/jabushka/benchmarks/src/main/java/javabushka/client/BenchmarkingApp.java b/java/jabushka/benchmarks/src/main/java/javabushka/client/BenchmarkingApp.java index cdf3a23f0f..c0341c8da3 100644 --- a/java/jabushka/benchmarks/src/main/java/javabushka/client/BenchmarkingApp.java +++ b/java/jabushka/benchmarks/src/main/java/javabushka/client/BenchmarkingApp.java @@ -77,7 +77,7 @@ private static Options getOptions() { options.addOption("C", "concurrentTasks", true, "Number of concurrent tasks [1 10 100]"); options.addOption("l", "clients", true, "one of: all|jedis|lettuce|babushka [all]"); options.addOption("h", "host", true, "host url [localhost]"); - options.addOption("p", "port", true, "port number [port]"); + options.addOption("p", "port", true, "port number [6379]"); options.addOption("n", "clientCount", true, "Client count [1]"); options.addOption("t", "tls", false, "TLS [true]");