Skip to content

Commit

Permalink
Add dataSize option to java benchmark. (#11)
Browse files Browse the repository at this point in the history
* Add Jedis and Lettuce benchmarks

* Start ignoring .gradle files

* Update gitignore and remove generated files from git

Signed-off-by: acarbonetto <[email protected]>

* Update gitignore and remove generated files from git

Signed-off-by: acarbonetto <[email protected]>

* Update gitignore and remove generated files from git

Signed-off-by: acarbonetto <[email protected]>

* Add benchmarks for GET non-existing

* Revert "Update gitignore and remove generated files from git"

This reverts commit d9b26a6.

* fix redis-rs submodules

Signed-off-by: acarbonetto <[email protected]>

* Randomize commands in Java benchmarks

* rename chooseAction to randomAction

* Add a Java benchmarking app (#7)

* Add a java app to run benchmarks

---------

Signed-off-by: acarbonetto <[email protected]>

* Add Readme and update install_and_test script to runJava

Signed-off-by: acarbonetto <[email protected]>

* Add Readme and update install_and_test script to runJava

Signed-off-by: acarbonetto <[email protected]>

* Combine java pipeline and java benchmarks (#8)

* Merge Pull Request #5 - Add java pipeline.

Also changed:
* Merged two projects.
* Updated CI.
* Fixed tests and updated `junit` version.
* Spotless.
* Add new gradle tasks.

Signed-off-by: Yury-Fridlyand <[email protected]>

* Add sync and async clients both to tests. (#12)

* Add sync and async clients both to tests.

Signed-off-by: Yury-Fridlyand <[email protected]>

* Minor fixes.

Signed-off-by: Yury-Fridlyand <[email protected]>

---------

Signed-off-by: Yury-Fridlyand <[email protected]>

* Add dataSize option to java benchmark.

Signed-off-by: Yury-Fridlyand <[email protected]>

---------

Signed-off-by: acarbonetto <[email protected]>
Signed-off-by: Yury-Fridlyand <[email protected]>
Co-authored-by: Jonathan Louie <[email protected]>
Co-authored-by: acarbonetto <[email protected]>
Co-authored-by: jonathanl-bq <[email protected]>
  • Loading branch information
4 people committed Oct 3, 2023
1 parent 016f5f6 commit e57c1ff
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 3 deletions.
25 changes: 23 additions & 2 deletions benchmarks/install_and_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,14 @@ function runJavaBenchmark(){
cd ${BENCH_FOLDER}/java
}

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 @@ -210,6 +218,21 @@ do
runJava=1
chosenClients="Jedis"
;;
-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 @@ -282,8 +305,6 @@ do
fi
done



flushDB

if [ $writeResultsCSV == 1 ];
Expand Down
1 change: 1 addition & 0 deletions java/jabushka/benchmarks/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ dependencies {
implementation 'redis.clients:jedis:4.4.3'
implementation 'io.lettuce:lettuce-core:6.2.6.RELEASE'
implementation 'commons-cli:commons-cli:1.5.0'
implementation group: 'org.apache.commons', name: 'commons-lang3', version: '3.13.0'
}

// Apply a specific Java toolchain to ease working on different environments.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ private static Options getOptions() {

options.addOption("c", "configuration", true, "Configuration flag [Release]");
options.addOption("f", "resultsFile", true, "Result filepath []");
options.addOption("d", "dataSize", true, "Data block size [20]");
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]");
Expand Down Expand Up @@ -118,6 +119,10 @@ private static RunConfiguration verifyOptions(CommandLine line) throws ParseExce
}
}

if (line.hasOption("dataSize")) {
runConfiguration.dataSize = Integer.parseInt(line.getOptionValue("dataSize"));
}

if (line.hasOption("concurrentTasks")) {
String concurrentTasks = line.getOptionValue("concurrentTasks");

Expand Down Expand Up @@ -200,6 +205,7 @@ public boolean isEqual(String other) {
public static class RunConfiguration {
public String configuration;
public Optional<FileWriter> resultsFile;
public int dataSize;
public List<Integer> concurrentTasks;
public ClientName[] clients;
public String host;
Expand All @@ -210,6 +216,7 @@ public static class RunConfiguration {
public RunConfiguration() {
configuration = "Release";
resultsFile = Optional.empty();
dataSize = 20;
concurrentTasks = List.of(1, 10, 100);
clients = new ClientName[] {ClientName.ALL};
host = "localhost";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import javabushka.client.BenchmarkingApp;
import javabushka.client.Client;
import javabushka.client.SyncClient;
import org.apache.commons.lang3.RandomStringUtils;

public class Benchmarking {
static final double PROB_GET = 0.8;
Expand Down Expand Up @@ -154,7 +155,7 @@ public static Map<ChosenAction, LatencyResults> measurePerformance(
client.connectToRedis(new ConnectionSettings(config.host, config.port, config.tls));

int iterations = 10000;
String value = "my-value";
String value = RandomStringUtils.randomAlphanumeric(config.dataSize);

if (config.resultsFile.isPresent()) {
try {
Expand Down

0 comments on commit e57c1ff

Please sign in to comment.