From e44f4f9fda37f2efd55591ed95299d98a8ff99b4 Mon Sep 17 00:00:00 2001 From: acarbonetto Date: Wed, 20 Sep 2023 00:40:10 -0700 Subject: [PATCH 1/2] Add Readme and update install_and_test script to runJava Signed-off-by: acarbonetto --- benchmarks/install_and_test.sh | 34 +++++++++++++++++-- java/README.md | 2 +- .../java-2-2023-09-20-00-01-35.json | 1 + .../javabushka/client/BenchmarkingApp.java | 3 +- 4 files changed, 35 insertions(+), 5 deletions(-) create mode 100644 java/benchmarks/java-2-2023-09-20-00-01-35.json 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/benchmarks/java-2-2023-09-20-00-01-35.json b/java/benchmarks/java-2-2023-09-20-00-01-35.json new file mode 100644 index 0000000000..aa38b95cf5 --- /dev/null +++ b/java/benchmarks/java-2-2023-09-20-00-01-35.json @@ -0,0 +1 @@ +LETTUCE client Benchmarking: Avg. time in ms per SET: 6.255784328470447E-4SET p50 latency in ms: 2.91E-4SET p90 latency in ms: 8.33E-4SET p99 latency in ms: 0.007625SET std dev in ms: 0.00217342597058043Avg. time in ms per GET_EXISTING: 6.61669922332828E-4GET_EXISTING p50 latency in ms: 2.5E-4GET_EXISTING p90 latency in ms: 6.25E-4GET_EXISTING p99 latency in ms: 0.007875GET_EXISTING std dev in ms: 0.021820083844063233Avg. time in ms per GET_NON_EXISTING: 5.872813472792927E-4GET_NON_EXISTING p50 latency in ms: 2.5E-4GET_NON_EXISTING p90 latency in ms: 7.08E-4GET_NON_EXISTING p99 latency in ms: 0.008291GET_NON_EXISTING std dev in ms: 0.0021284746375641456 \ No newline at end of file diff --git a/java/benchmarks/src/main/java/javabushka/client/BenchmarkingApp.java b/java/benchmarks/src/main/java/javabushka/client/BenchmarkingApp.java index d17e127727..e57e3e5bc2 100644 --- a/java/benchmarks/src/main/java/javabushka/client/BenchmarkingApp.java +++ b/java/benchmarks/src/main/java/javabushka/client/BenchmarkingApp.java @@ -12,7 +12,6 @@ import javabushka.client.lettuce.LettuceAsyncClient; import javabushka.client.utils.Benchmarking; import javabushka.client.utils.ChosenAction; -import javabushka.client.utils.LatencyResults; import org.apache.commons.cli.CommandLine; import org.apache.commons.cli.CommandLineParser; import org.apache.commons.cli.DefaultParser; @@ -82,7 +81,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]"); From 1391bed73c5af29a7880a2ba89765571f6e38aab Mon Sep 17 00:00:00 2001 From: acarbonetto Date: Wed, 20 Sep 2023 00:42:14 -0700 Subject: [PATCH 2/2] Add Readme and update install_and_test script to runJava Signed-off-by: acarbonetto --- java/benchmarks/java-2-2023-09-20-00-01-35.json | 1 - 1 file changed, 1 deletion(-) delete mode 100644 java/benchmarks/java-2-2023-09-20-00-01-35.json diff --git a/java/benchmarks/java-2-2023-09-20-00-01-35.json b/java/benchmarks/java-2-2023-09-20-00-01-35.json deleted file mode 100644 index aa38b95cf5..0000000000 --- a/java/benchmarks/java-2-2023-09-20-00-01-35.json +++ /dev/null @@ -1 +0,0 @@ -LETTUCE client Benchmarking: Avg. time in ms per SET: 6.255784328470447E-4SET p50 latency in ms: 2.91E-4SET p90 latency in ms: 8.33E-4SET p99 latency in ms: 0.007625SET std dev in ms: 0.00217342597058043Avg. time in ms per GET_EXISTING: 6.61669922332828E-4GET_EXISTING p50 latency in ms: 2.5E-4GET_EXISTING p90 latency in ms: 6.25E-4GET_EXISTING p99 latency in ms: 0.007875GET_EXISTING std dev in ms: 0.021820083844063233Avg. time in ms per GET_NON_EXISTING: 5.872813472792927E-4GET_NON_EXISTING p50 latency in ms: 2.5E-4GET_NON_EXISTING p90 latency in ms: 7.08E-4GET_NON_EXISTING p99 latency in ms: 0.008291GET_NON_EXISTING std dev in ms: 0.0021284746375641456 \ No newline at end of file