Skip to content
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: 0 additions & 2 deletions continuous_load_testing/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
FROM eclipse-temurin
COPY build/install/continuous_load_testing /app
# Uncomment the line below to enable CloudPath instead of DirectPath
# ENV GOOGLE_CLOUD_DISABLE_DIRECT_PATH=true
CMD /app/bin/continuous_load_testing --methods=EmptyCall --concurrency=1
3 changes: 3 additions & 0 deletions continuous_load_testing/Dockerfile.cloudpath
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
FROM eclipse-temurin
COPY build/install/continuous_load_testing /app
CMD /app/bin/continuous_load_testing --methods=EmptyCall --concurrency=1 --disable_directpath=true
2 changes: 0 additions & 2 deletions continuous_load_testing/client-java-cloudpath.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,6 @@ spec:
fieldPath: metadata.namespace
- name: CONTAINER_NAME
value: client-java-cloudpath
- name: GOOGLE_CLOUD_DISABLE_DIRECT_PATH
value: "true"
- name: OTEL_RESOURCE_ATTRIBUTES
value: k8s.pod.name=$(POD_NAME),k8s.namespace.name=$(NAMESPACE_NAME),k8s.container.name=$(CONTAINER_NAME)
resources:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,12 @@ private enum Method {
}

private static final Logger logger = Logger.getLogger(Client.class.getName());
private static final String BACKEND = "google-c2p:///directpathgrpctesting-pa.googleapis.com";
private static final String DIRECTPATH_BACKEND = "google-c2p:///directpathgrpctesting-pa.googleapis.com";
private static final String CLOUDPATH_BACKEND = "dns:///directpathgrpctesting-pa.googleapis.com";
private static final Set<Method> methods = new HashSet<>(Arrays.asList(Method.values()));
private static int concurrency = 1;
private static int num_of_requests = 10;
private static boolean disable_directpath = false;

private static final Collection<String> METRICS =
ImmutableList.of(
Expand Down Expand Up @@ -79,7 +81,8 @@ public static void main(String[] args) {
GrpcOpenTelemetry grpcOpenTelemetry = initializeOpenTelemetry();

ChannelCredentials credentials = GoogleDefaultChannelCredentials.create();
ManagedChannelBuilder<?> builder = Grpc.newChannelBuilder(BACKEND, credentials);
String backend = disable_directpath ? CLOUDPATH_BACKEND : DIRECTPATH_BACKEND;
ManagedChannelBuilder<?> builder = Grpc.newChannelBuilder(backend, credentials);
grpcOpenTelemetry.configureChannelBuilder(builder);
TestServiceStub stub = TestServiceGrpc.newStub(builder.build());

Expand Down Expand Up @@ -126,10 +129,14 @@ private static void parseArgs(String[] args) {
if (arg.startsWith("--num_of_requests=")) {
num_of_requests = Integer.parseInt(arg.substring("--num_of_requests=".length()));
}
if (arg.startsWith("--disable_directpath=")) {
disable_directpath = Boolean.parseBoolean(arg.substring("--disable_directpath=".length()));
}
}
logger.info("methods: " + methods);
logger.info("concurrency: " + concurrency);
logger.info("num_of_requests: " + num_of_requests);
logger.info("disable_directpath:" + disable_directpath);
}

private static GrpcOpenTelemetry initializeOpenTelemetry() {
Expand Down