Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix java min benchmarking. #105

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/install-shared-dependencies/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ runs:
shell: bash
if: "${{ inputs.os == 'macos-latest' }}"
run: |
brew install git gcc pkgconfig openssl redis
brew install git gcc pkgconfig openssl redis coreutils
- name: Install software dependencies for Ubuntu
shell: bash
Expand Down
56 changes: 0 additions & 56 deletions .github/workflows/java-benchmark.yml

This file was deleted.

21 changes: 17 additions & 4 deletions .github/workflows/java.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,22 @@ on:
paths:
- glide-core/**
- submodules/**
- "java/**"
- ".github/workflows/java.yml"
- java/**
- .github/workflows/java.yml
- .github/workflows/install-shared-dependencies/action.yml
- .github/workflows/install-redis/action.yml
- .github/workflows/test-benchmark/action.yml
- .github/workflows/lint-rust/action.yml
pull_request:
paths:
- glide-core/**
- submodules/**
- "java/**"
- ".github/workflows/java.yml"
- java/**
- .github/workflows/java.yml
- .github/workflows/install-shared-dependencies/action.yml
- .github/workflows/install-redis/action.yml
- .github/workflows/test-benchmark/action.yml
- .github/workflows/lint-rust/action.yml

jobs:
build-and-test-java-client:
Expand Down Expand Up @@ -67,6 +75,10 @@ jobs:
working-directory: java
run: ./gradlew spotlessDiagnose | grep 'All formatters are well behaved for all files'

- uses: ./.github/workflows/test-benchmark
with:
language-flag: -java

- name: Upload test reports
if: always()
continue-on-error: true
Expand All @@ -77,6 +89,7 @@ jobs:
java/client/build/reports/**
java/integTest/build/reports/**
utils/clusters/**
benchmarks/results/**

build-amazonlinux-latest:
if: github.repository_owner == 'aws'
Expand Down
6 changes: 1 addition & 5 deletions benchmarks/install_and_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ chosenClients="all"
host="localhost"
port=6379
tlsFlag="--tls"
javaTlsFlag="-tls"

function runPythonBenchmark(){
# generate protobuf files
Expand Down Expand Up @@ -74,7 +73,7 @@ function runCSharpBenchmark(){

function runJavaBenchmark(){
cd ${BENCH_FOLDER}/../java
./gradlew :benchmarks:run --args="-resultsFile \"${BENCH_FOLDER}/$1\" -dataSize \"$2\" -concurrentTasks \"$concurrentTasks\" -clients \"$chosenClients\" -host $host $javaPortFlag -clientCount \"$clientCount\" $javaTlsFlag $javaClusterFlag"
./gradlew :benchmarks:run --args="-resultsFile \"${BENCH_FOLDER}/$1\" --dataSize \"$2\" --concurrentTasks \"$concurrentTasks\" --clients \"$chosenClients\" --host $host $portFlag --clientCount \"$clientCount\" $tlsFlag $clusterFlag $minimalFlag"
}

function runRustBenchmark(){
Expand Down Expand Up @@ -218,15 +217,12 @@ do
-no-csv) writeResultsCSV=0 ;;
-no-tls)
tlsFlag=
javaTlsFlag=
;;
-is-cluster)
clusterFlag="--clusterModeEnabled"
javaClusterFlag="-clusterModeEnabled"
;;
-port)
portFlag="--port "$2
javaPortFlag="-port "$2
shift
;;
-minimal)
Expand Down
4 changes: 2 additions & 2 deletions java/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,8 @@ assert getResponse.get() == "foobar" : "Failed on client.get("key") request";
You can run benchmarks using `./gradlew run`. You can set arguments using the args flag like:

```shell
./gradlew run --args="-help"
./gradlew run --args="-resultsFile=output -dataSize \"100 1000\" -concurrentTasks \"10 100\" -clients all -host localhost -port 6279 -clientCount \"1 5\" -tls"
./gradlew run --args="--help"
./gradlew run --args="--resultsFile=output --dataSize \"100 1000\" --concurrentTasks \"10 100\" --clients all --host localhost --port 6279 --clientCount \"1 5\" --tls"
```

The following arguments are accepted:
Expand Down
56 changes: 43 additions & 13 deletions java/benchmarks/src/main/java/glide/benchmarks/BenchmarkingApp.java
Original file line number Diff line number Diff line change
Expand Up @@ -66,36 +66,66 @@ private static Options getOptions() {
// create the Options
Options options = new Options();

options.addOption(Option.builder("help").desc("print this message").build());
options.addOption(Option.builder("h").longOpt("help").desc("Print this message").build());

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are we going to update this message later? Or is it meant to just be a dummy message? If we want to update this later, let's make sure that it doesn't fall through the cracks.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A dummy message

options.addOption(
Option.builder("configuration").hasArg(true).desc("Configuration flag [Release]").build());
Option.builder()
.longOpt("configuration")
.hasArg(true)
.desc("Configuration flag [Release]")
.build());
options.addOption(
Option.builder("resultsFile")
Option.builder()
.longOpt("resultsFile")
.hasArg(true)
.desc("Result filepath (stdout if empty) []")
.build());
options.addOption(
Option.builder("dataSize").hasArg(true).desc("Data block size [100 4000]").build());
Option.builder()
.longOpt("dataSize")
.hasArg(true)
.desc("Data block size [100 4000]")
.build());
options.addOption(
Option.builder("concurrentTasks")
Option.builder()
.longOpt("concurrentTasks")
.hasArg(true)
.desc("Number of concurrent tasks [100, 1000]")
.build());
options.addOption(
Option.builder("clients").hasArg(true).desc("one of: all|jedis|lettuce|glide").build());
options.addOption(Option.builder("host").hasArg(true).desc("Hostname [localhost]").build());
options.addOption(Option.builder("port").hasArg(true).desc("Port number [6379]").build());
Option.builder()
.longOpt("clients")
.hasArg(true)
.desc("one of: all|jedis|lettuce|glide")
.build());
options.addOption(
Option.builder("clientCount").hasArg(true).desc("Number of clients to run [1]").build());
options.addOption(Option.builder("tls").hasArg(false).desc("TLS [false]").build());
Option.builder().longOpt("host").hasArg(true).desc("Hostname [localhost]").build());
options.addOption(
Option.builder("clusterModeEnabled")
Option.builder().longOpt("port").hasArg(true).desc("Port number [6379]").build());
options.addOption(
Option.builder()
.longOpt("clientCount")
.hasArg(true)
.desc("Number of clients to run [1]")
.build());
options.addOption(Option.builder().longOpt("tls").hasArg(false).desc("TLS [false]").build());
options.addOption(
Option.builder()
.longOpt("clusterModeEnabled")
.hasArg(false)
.desc("Is cluster-mode enabled, other standalone mode is used [false]")
.build());
Option.builder("minimal").hasArg(false).desc("Run·benchmark·in·minimal·mode").build();
options.addOption(
Option.builder("debugLogging").hasArg(false).desc("Verbose logs [false]").build());
Option.builder()
.longOpt("minimal")
.hasArg(false)
.desc("Run benchmark in minimal mode")
.build());
options.addOption(
Option.builder()
.longOpt("debugLogging")
.hasArg(false)
.desc("Verbose logs [false]")
.build());

return options;
}
Expand Down
Loading