You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@geode.apache.org by GitBox <gi...@apache.org> on 2020/07/10 23:55:35 UTC

[GitHub] [geode-benchmarks] Bill commented on a change in pull request #130: initial implementation of withClusterTopology

Bill commented on a change in pull request #130:
URL: https://github.com/apache/geode-benchmarks/pull/130#discussion_r453122053



##########
File path: geode-benchmarks/src/main/java/org/apache/geode/benchmark/tests/PartitionedGetBenchmark.java
##########
@@ -56,9 +56,14 @@ public void setKeyRange(final LongRange keyRange) {
   public TestConfig configure() {
     TestConfig config = GeodeBenchmark.createConfig();
     before(config, new CreatePartitionedRegion(), SERVER);
-    before(config, new CreateClientProxyRegion(), CLIENT);
-    before(config, new PrePopulateRegion(keyRange), CLIENT);
-    workload(config, new GetTask(keyRange), CLIENT);
+    if (config.getRoles().containsKey(CLIENT)) {
+      before(config, new CreateClientProxyRegion(), CLIENT);
+      before(config, new PrePopulateRegion(keyRange), CLIENT);
+      workload(config, new GetTask(keyRange), CLIENT);
+    } else {
+      before(config, new PrePopulateRegion(keyRange), CLIENT);
+      workload(config, new GetTask(keyRange), CLIENT);

Review comment:
       run these on `SERVER` role, not `CLIENT` one

##########
File path: geode-benchmarks/src/main/java/org/apache/geode/benchmark/topology/ClusterTopology.java
##########
@@ -0,0 +1,56 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more contributor license
+ * agreements. See the NOTICE file distributed with this work for additional information regarding
+ * copyright ownership. The ASF licenses this file to You under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the License. You may obtain a
+ * copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software distributed under the License
+ * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
+ * or implied. See the License for the specific language governing permissions and limitations under
+ * the License.
+ */
+package org.apache.geode.benchmark.topology;
+
+import static org.apache.geode.benchmark.Config.before;
+import static org.apache.geode.benchmark.Config.role;
+import static org.apache.geode.benchmark.parameters.Utils.addToTestConfig;
+import static org.apache.geode.benchmark.topology.Ports.LOCATOR_PORT;
+import static org.apache.geode.benchmark.topology.Roles.LOCATOR;
+import static org.apache.geode.benchmark.topology.Roles.SERVER;
+
+import org.apache.geode.benchmark.parameters.GcLoggingParameters;
+import org.apache.geode.benchmark.parameters.GcParameters;
+import org.apache.geode.benchmark.parameters.HeapParameters;
+import org.apache.geode.benchmark.parameters.JvmParameters;
+import org.apache.geode.benchmark.parameters.ProfilerParameters;
+import org.apache.geode.benchmark.tasks.StartLocator;
+import org.apache.geode.benchmark.tasks.StartServer;
+import org.apache.geode.perftest.TestConfig;
+
+public class ClusterTopology {
+  private static final int NUM_LOCATORS = 1;
+  private static final int NUM_SERVERS = 3;
+  private static final String WITH_SSL_ARGUMENT = "-DwithSsl=true";
+  private static final String WITH_SECURITY_MANAGER_ARGUMENT = "-DwithSecurityManager=true";
+
+  public static void configure(TestConfig config) {
+    role(config, LOCATOR, NUM_LOCATORS);
+    role(config, SERVER, NUM_SERVERS);
+
+    JvmParameters.configure(config);
+    HeapParameters.configure(config);
+    GcLoggingParameters.configure(config);
+    GcParameters.configure(config);
+    ProfilerParameters.configure(config);
+
+    addToTestConfig(config, "withSsl", WITH_SSL_ARGUMENT);

Review comment:
       TBD if this will do what you want. You're trying to trick `JVMLauncher.buildCommand()` to see the JVM arg `"-DwithSsl=true"`. This might work (I'm testing it now.) But the way `ClientServerTopologyWithSNIProxy` accomplishes the trick is via:
   
   ```java
   configureGeodeProductJvms(config, WITH_SSL_ARGUMENT);
   ```
   
   If this way here works better though, I recommend changing the SNI topology to do it this way too since `addToTestConfig(...)` seems like a better way for a topology to communicate its intentions.

##########
File path: geode-benchmarks/build.gradle
##########
@@ -93,6 +93,7 @@ task benchmark(type: Test) {
   }
   systemProperty 'withSsl', project.hasProperty('withSsl')
   systemProperty 'withSniProxy', project.hasProperty('withSniProxy')
+  systemProperty 'withClusterTopology', project.hasProperty('withSniProxy')

Review comment:
       I think @pivotal-jbarrett meant to say: `project.hasProperty('withClusterTopology')`

##########
File path: geode-benchmarks/src/test/java/org/apache/geode/benchmark/tests/GeodeBenchmarkTest.java
##########
@@ -36,46 +36,66 @@
  */
 class GeodeBenchmarkTest {
 
+  public static final String WITH_CLUSTER_TOPOLOGY = "withClusterTopology";
+  public static final String WITH_SNI_PROXY = "withSniProxy";
   private TestConfig config;
   private TestStep startProxyStep;
 
   @BeforeEach
   public void beforeEach() {
+    System.clearProperty(WITH_SNI_PROXY);
+    System.clearProperty(WITH_CLUSTER_TOPOLOGY);

Review comment:
       The old `@AfterAll` prevented subsequent tests run in the same JVM from seeing these system properties. This approach leaves the system properties in effect after the test finishes.
   
   Is that important? Seems like it might be good to be sure and clear those in an `@AfterAll`.

##########
File path: geode-benchmarks/src/test/java/org/apache/geode/benchmark/tests/GeodeBenchmarkTest.java
##########
@@ -36,46 +36,66 @@
  */
 class GeodeBenchmarkTest {
 
+  public static final String WITH_CLUSTER_TOPOLOGY = "withClusterTopology";
+  public static final String WITH_SNI_PROXY = "withSniProxy";

Review comment:
       good DRY




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org