Skip to content

Commit

Permalink
Add Readme and update install_and_test script to runJava
Browse files Browse the repository at this point in the history
Signed-off-by: acarbonetto <[email protected]>
  • Loading branch information
acarbonetto committed Oct 3, 2023
1 parent 1983974 commit 6c1fb45
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 5 deletions.
34 changes: 32 additions & 2 deletions benchmarks/install_and_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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(){
Expand Down Expand Up @@ -68,6 +70,14 @@ function runCSharpBenchmark(){
dotnet run --configuration Release --resultsFile=../$1 --dataSize $2 --concurrentTasks $concurrentTasks --clients $chosenClients --host $host --clientCount $clientCount $tlsFlag $portFlag
}

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
Expand Down Expand Up @@ -185,6 +195,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
Expand Down Expand Up @@ -242,6 +267,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)
Expand All @@ -250,8 +282,6 @@ do
fi
done



flushDB

if [ $writeResultsCSV == 1 ];
Expand Down
2 changes: 1 addition & 1 deletion java/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
1 change: 1 addition & 0 deletions java/benchmarks/java-2-2023-09-20-00-01-35.json
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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]");

Expand Down

0 comments on commit 6c1fb45

Please sign in to comment.