Skip to content

Commit

Permalink
Add java benchmark support.
Browse files Browse the repository at this point in the history
  • Loading branch information
nihohit committed Dec 6, 2023
1 parent 7eb363e commit 8173fd3
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
4 changes: 4 additions & 0 deletions .github/workflows/java.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,3 +67,7 @@ jobs:
path: |
java/client/build/reports/**
java/integTest/build/reports/**
- uses: ./.github/workflows/test-benchmark
with:
language-flag: -java
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ private static Options getOptions() {
.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());

Expand Down Expand Up @@ -148,6 +149,7 @@ private static RunConfiguration verifyOptions(CommandLine line) throws ParseExce

runConfiguration.tls = line.hasOption("tls");
runConfiguration.clusterModeEnabled = line.hasOption("clusterModeEnabled");
runConfiguration.minimal = line.hasOption("minimal");
runConfiguration.debugLogging = line.hasOption("debugLogging");

return runConfiguration;
Expand Down Expand Up @@ -206,6 +208,7 @@ public static class RunConfiguration {
public boolean tls;
public boolean clusterModeEnabled;
public boolean debugLogging = false;
public boolean minimal = false;

public RunConfiguration() {
configuration = "Release";
Expand All @@ -221,6 +224,7 @@ public RunConfiguration() {
clientCount = new int[] {1};
tls = false;
clusterModeEnabled = false;
minimal = false;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,8 @@ public static void printResults(
public static void testClientSetGet(
Supplier<Client> clientCreator, BenchmarkingApp.RunConfiguration config, boolean async) {
for (int concurrentNum : config.concurrentTasks) {
int iterations = Math.min(Math.max(100000, concurrentNum * 10000), 10000000);
int iterations =
config.minimal ? 1000 : Math.min(Math.max(100000, concurrentNum * 10000), 10000000);
for (int clientCount : config.clientCount) {
for (int dataSize : config.dataSize) {
// create clients
Expand Down

0 comments on commit 8173fd3

Please sign in to comment.