Skip to content

Commit 201ac94

Browse files
chore(benchmarking): Use api when determining workload runs (#2404)
* chore(benchmarking): Use api when determining workload runs * Make api required * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md --------- Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
1 parent b7f6eb3 commit 201ac94

File tree

1 file changed

+15
-5
lines changed

1 file changed

+15
-5
lines changed

storage-shared-benchmarking/src/main/java/com/google/cloud/storage/benchmarking/StorageSharedBenchmarkingCli.java

+15-5
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ public final class StorageSharedBenchmarkingCli implements Runnable {
5353
description = "Number of workers to run in parallel for the workload")
5454
int workers;
5555

56-
@Option(names = "-api", defaultValue = "JSON", description = "API to use")
56+
@Option(names = "-api", description = "API to use", required = true)
5757
String api;
5858

5959
@Option(
@@ -106,15 +106,25 @@ public void run() {
106106
case "w1r3":
107107
runWorkload1();
108108
break;
109-
case "w1r3-grpc-dp":
110-
runWorkload4();
111-
break;
112109
default:
113110
throw new IllegalStateException("Specify a workload to run");
114111
}
115112
}
116113

117114
private void runWorkload1() {
115+
switch (api) {
116+
case "JSON":
117+
runWorkload1Json();
118+
break;
119+
case "DirectPath":
120+
runWorkload1DirectPath();
121+
break;
122+
default:
123+
throw new IllegalStateException("Specify an API to use");
124+
}
125+
}
126+
127+
private void runWorkload1Json() {
118128
RetrySettings retrySettings = StorageOptions.getDefaultRetrySettings().toBuilder().build();
119129

120130
StorageOptions retryStorageOptions =
@@ -128,7 +138,7 @@ private void runWorkload1() {
128138
}
129139
}
130140

131-
private void runWorkload4() {
141+
private void runWorkload1DirectPath() {
132142
RetrySettings retrySettings = StorageOptions.getDefaultRetrySettings().toBuilder().build();
133143
StorageOptions retryStorageOptions =
134144
StorageOptions.grpc().setRetrySettings(retrySettings).setAttemptDirectPath(true).build();

0 commit comments

Comments
 (0)