You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@geode.apache.org by bu...@apache.org on 2020/06/01 22:04:42 UTC
[geode-benchmarks] branch sni updated: added StopClient task to
stop client before proxy
This is an automated email from the ASF dual-hosted git repository.
burcham pushed a commit to branch sni
in repository https://gitbox.apache.org/repos/asf/geode-benchmarks.git
The following commit(s) were added to refs/heads/sni by this push:
new 5ad83af added StopClient task to stop client before proxy
5ad83af is described below
commit 5ad83af2b6a1a626904c470768bd3ccd75aef27c
Author: Bill Burcham <bb...@pivotal.io>
AuthorDate: Mon Jun 1 15:04:29 2020 -0700
added StopClient task to stop client before proxy
---
.../java/org/apache/geode/benchmark/Config.java | 3 +-
.../apache/geode/benchmark/tasks/StopClient.java | 46 ++++++++++++++++++++++
.../topology/ClientServerTopologyWithSNIProxy.java | 2 +
3 files changed, 49 insertions(+), 2 deletions(-)
diff --git a/geode-benchmarks/src/main/java/org/apache/geode/benchmark/Config.java b/geode-benchmarks/src/main/java/org/apache/geode/benchmark/Config.java
index a054f24..c60d9a4 100644
--- a/geode-benchmarks/src/main/java/org/apache/geode/benchmark/Config.java
+++ b/geode-benchmarks/src/main/java/org/apache/geode/benchmark/Config.java
@@ -2,7 +2,6 @@ package org.apache.geode.benchmark;
import org.yardstickframework.BenchmarkDriver;
-import org.apache.geode.benchmark.tasks.StopSniProxy;
import org.apache.geode.benchmark.topology.Roles;
import org.apache.geode.perftest.Task;
import org.apache.geode.perftest.TestConfig;
@@ -27,7 +26,7 @@ public class Config {
config.workload(task, role.name());
}
- public static void after(final TestConfig config, final StopSniProxy task, final Roles role) {
+ public static void after(final TestConfig config, final Task task, final Roles role) {
config.after(task, role.name());
}
diff --git a/geode-benchmarks/src/main/java/org/apache/geode/benchmark/tasks/StopClient.java b/geode-benchmarks/src/main/java/org/apache/geode/benchmark/tasks/StopClient.java
new file mode 100644
index 0000000..cf23538
--- /dev/null
+++ b/geode-benchmarks/src/main/java/org/apache/geode/benchmark/tasks/StopClient.java
@@ -0,0 +1,46 @@
+/*
+ * 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.tasks;
+
+import static org.apache.geode.benchmark.parameters.GeodeProperties.clientProperties;
+import static org.apache.geode.benchmark.topology.Roles.LOCATOR;
+
+import java.io.File;
+import java.net.InetAddress;
+import java.net.UnknownHostException;
+import java.util.Properties;
+
+import org.apache.geode.cache.client.ClientCache;
+import org.apache.geode.cache.client.ClientCacheFactory;
+import org.apache.geode.distributed.ConfigurationProperties;
+import org.apache.geode.pdx.ReflectionBasedAutoSerializer;
+import org.apache.geode.perftest.Task;
+import org.apache.geode.perftest.TestContext;
+
+/**
+ * Task to create the client cache
+ */
+public class StopClient implements Task {
+
+ @Override
+ public void run(TestContext context) throws Exception {
+ ClientCache cache = ClientCacheFactory.getAnyInstance();
+ cache.close();
+ }
+
+}
diff --git a/geode-benchmarks/src/main/java/org/apache/geode/benchmark/topology/ClientServerTopologyWithSNIProxy.java b/geode-benchmarks/src/main/java/org/apache/geode/benchmark/topology/ClientServerTopologyWithSNIProxy.java
index 10a089f..0dcb050 100644
--- a/geode-benchmarks/src/main/java/org/apache/geode/benchmark/topology/ClientServerTopologyWithSNIProxy.java
+++ b/geode-benchmarks/src/main/java/org/apache/geode/benchmark/topology/ClientServerTopologyWithSNIProxy.java
@@ -40,6 +40,7 @@ import org.apache.geode.benchmark.tasks.StartClientSNI;
import org.apache.geode.benchmark.tasks.StartLocatorSNI;
import org.apache.geode.benchmark.tasks.StartServerSNI;
import org.apache.geode.benchmark.tasks.StartSniProxy;
+import org.apache.geode.benchmark.tasks.StopClient;
import org.apache.geode.benchmark.tasks.StopSniProxy;
import org.apache.geode.perftest.TestConfig;
@@ -78,6 +79,7 @@ public class ClientServerTopologyWithSNIProxy {
before(config, new StartSniProxy(LOCATOR_PORT), PROXY);
before(config, new StartClientSNI(LOCATOR_PORT), CLIENT);
+ after(config, new StopClient(), CLIENT);
after(config, new StopSniProxy(), PROXY);
}