Skip to content

Commit

Permalink
Java: Fix benchmarkApp to support port (valkey-io#2170)
Browse files Browse the repository at this point in the history
* Java: Add port and examples for benchmark app

Signed-off-by: Andrew Carbonetto <[email protected]>
  • Loading branch information
acarbonetto authored Aug 20, 2024
1 parent c397ce7 commit 681d360
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
10 changes: 10 additions & 0 deletions java/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -271,11 +271,21 @@ For more examples, you can refer to the test folder [unit tests](./client/src/te

You can run benchmarks using `./gradlew run`. You can set arguments using the args flag like:

Returns the command help output
```shell
./gradlew run --args="--help"
```

Runs all benchmark clients against a local instance with TLS enabled using data sizing 100 and 1000 bytes, 10 and 100 concurrent tasks, 1 and 5 parallel clients.
```shell
./gradlew run --args="--resultsFile=output --dataSize \"100 1000\" --concurrentTasks \"10 100\" --clients all --host localhost --port 6279 --clientCount \"1 5\" --tls"
```

Runs GLIDE client against a local cluster instance on port 52756 using data sizing 4000 bytes, and 1000 concurrent tasks.
```shell
./gradlew run --args="--resultsFile=output --dataSize \"4000\" --concurrentTasks \"1000\" --clients glide --host 127.0.0.1 --port 52746 --clusterModeEnabled"
```

The following arguments are accepted:
* `resultsFile`: the results output file
* `concurrentTasks`: number of concurrent tasks
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,10 @@ private static RunConfiguration verifyOptions(CommandLine line) throws ParseExce
runConfiguration.host = line.getOptionValue("host");
}

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

if (line.hasOption("clientCount")) {
runConfiguration.clientCount = parseIntListOption(line.getOptionValue("clientCount"));
}
Expand Down

0 comments on commit 681d360

Please sign in to comment.