This is an automated email from the ASF dual-hosted git repository. nnag pushed a commit to branch develop in repository https://gitbox.apache.org/repos/asf/geode-benchmarks.git
The following commit(s) were added to refs/heads/develop by this push: new feab250 GEODE-6311: Adding the OQL benchmarks (#49) feab250 is described below commit feab2509f4f6b3fecdc71538b8dfe75771427145 Author: Nabarun Nag <nabarun...@users.noreply.github.com> AuthorDate: Wed Jan 23 13:46:54 2019 -0800 GEODE-6311: Adding the OQL benchmarks (#49) --- .../geode/benchmark/tasks/CreateIndexOnID.java | 34 +++++++++ .../org/apache/geode/benchmark/tasks/OQLQuery.java | 86 ++++++++++++++++++++++ .../tests/PartitionedIndexedQueryBenchmark.java | 62 ++++++++++++++++ .../tests/PartitionedNonIndexedQueryBenchmark.java | 60 +++++++++++++++ .../tests/ReplicatedIndexedQueryBenchmark.java | 62 ++++++++++++++++ .../tests/ReplicatedNonIndexedQueryBenchmark.java | 60 +++++++++++++++ .../PartitionedIndexedQueryBenchmarkTest.java | 44 +++++++++++ .../PartitionedNonIndexedQueryBenchmarkTest.java | 44 +++++++++++ .../tests/ReplicatedIndexedQueryBenchmarkTest.java | 44 +++++++++++ .../ReplicatedNonIndexedQueryBenchmarkTest.java | 44 +++++++++++ 10 files changed, 540 insertions(+) diff --git a/geode-benchmarks/src/main/java/org/apache/geode/benchmark/tasks/CreateIndexOnID.java b/geode-benchmarks/src/main/java/org/apache/geode/benchmark/tasks/CreateIndexOnID.java new file mode 100644 index 0000000..0201898 --- /dev/null +++ b/geode-benchmarks/src/main/java/org/apache/geode/benchmark/tasks/CreateIndexOnID.java @@ -0,0 +1,34 @@ +/* + * 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 org.apache.geode.cache.Cache; +import org.apache.geode.cache.query.IndexNameConflictException; +import org.apache.geode.perftest.Task; +import org.apache.geode.perftest.TestContext; + +public class CreateIndexOnID implements Task { + + @Override + public void run(TestContext context) throws Exception { + Cache serverCache = (Cache) context.getAttribute("SERVER_CACHE"); + try { + serverCache.getQueryService().createIndex("IDIndex", "r.ID", "/region r"); + } catch (IndexNameConflictException ex) { + + } + } +} diff --git a/geode-benchmarks/src/main/java/org/apache/geode/benchmark/tasks/OQLQuery.java b/geode-benchmarks/src/main/java/org/apache/geode/benchmark/tasks/OQLQuery.java new file mode 100644 index 0000000..3dc72e7 --- /dev/null +++ b/geode-benchmarks/src/main/java/org/apache/geode/benchmark/tasks/OQLQuery.java @@ -0,0 +1,86 @@ +/* + * 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 java.io.Serializable; +import java.util.Map; +import java.util.concurrent.ThreadLocalRandom; + +import benchmark.geode.data.Portfolio; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.yardstickframework.BenchmarkConfiguration; +import org.yardstickframework.BenchmarkDriverAdapter; + +import org.apache.geode.cache.Region; +import org.apache.geode.cache.client.ClientCache; +import org.apache.geode.cache.client.ClientCacheFactory; +import org.apache.geode.cache.query.FunctionDomainException; +import org.apache.geode.cache.query.NameResolutionException; +import org.apache.geode.cache.query.QueryInvocationTargetException; +import org.apache.geode.cache.query.QueryService; +import org.apache.geode.cache.query.SelectResults; +import org.apache.geode.cache.query.TypeMismatchException; +import org.apache.geode.perftest.jvms.RemoteJVMFactory; + +public class OQLQuery extends BenchmarkDriverAdapter implements Serializable { + private static final Logger logger = LoggerFactory.getLogger(RemoteJVMFactory.class); + private Region<Object, Object> region; + private long keyRange; + private long queryRange; + ClientCache cache; + + public OQLQuery(long keyRange, long queryRange) { + this.keyRange = keyRange; + this.queryRange = queryRange; + } + + @Override + public void setUp(BenchmarkConfiguration cfg) throws Exception { + super.setUp(cfg); + cache = ClientCacheFactory.getAnyInstance(); + region = cache.getRegion("region"); + } + + @Override + public boolean test(Map<Object, Object> ctx) throws Exception { + long minId = ThreadLocalRandom.current().nextLong(0, this.keyRange - queryRange); + long maxId = minId + queryRange; + + SelectResults results = executeQuery(minId, maxId); + verifyResults(results, minId, maxId); + + return true; + } + + private void verifyResults(SelectResults results, long minId, long maxId) throws Exception { + for (Object result : results) { + long id = ((Portfolio) result).getID(); + if (id < minId || id > maxId) { + throw new Exception("Invalid Portfolio object retrieved [min =" + minId + " max =" + maxId + + "] Portfolio retrieved =" + ((Portfolio) result)); + } + } + } + + private SelectResults executeQuery(long minId, long maxId) + throws NameResolutionException, TypeMismatchException, QueryInvocationTargetException, + FunctionDomainException { + QueryService queryService = cache.getQueryService(); + return (SelectResults) queryService + .newQuery("SELECT * FROM /region r WHERE r.ID >=" + minId + " AND r.ID <=" + maxId) + .execute(); + } +} diff --git a/geode-benchmarks/src/main/java/org/apache/geode/benchmark/tests/PartitionedIndexedQueryBenchmark.java b/geode-benchmarks/src/main/java/org/apache/geode/benchmark/tests/PartitionedIndexedQueryBenchmark.java new file mode 100644 index 0000000..e58e121 --- /dev/null +++ b/geode-benchmarks/src/main/java/org/apache/geode/benchmark/tests/PartitionedIndexedQueryBenchmark.java @@ -0,0 +1,62 @@ +/* + * 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.tests; + +import static org.apache.geode.benchmark.topology.ClientServerTopology.Roles.CLIENT; +import static org.apache.geode.benchmark.topology.ClientServerTopology.Roles.SERVER; + +import org.junit.jupiter.api.Test; + +import org.apache.geode.benchmark.tasks.CreateClientProxyRegion; +import org.apache.geode.benchmark.tasks.CreateIndexOnID; +import org.apache.geode.benchmark.tasks.CreatePartitionedRegion; +import org.apache.geode.benchmark.tasks.OQLQuery; +import org.apache.geode.benchmark.tasks.PrePopulateRegion; +import org.apache.geode.benchmark.topology.ClientServerTopology; +import org.apache.geode.perftest.PerformanceTest; +import org.apache.geode.perftest.TestConfig; +import org.apache.geode.perftest.TestRunners; + +public class PartitionedIndexedQueryBenchmark implements PerformanceTest { + private long keyRange = 500000; + private long queryRange = 1000; + + public PartitionedIndexedQueryBenchmark() {} + + public void setKeyRange(long keyRange) { + this.keyRange = keyRange; + } + + public void setQueryRange(long queryRange) { + this.queryRange = queryRange; + } + + @Test + public void run() throws Exception { + TestRunners.defaultRunner().runTest(this); + } + + @Override + public TestConfig configure() { + TestConfig config = GeodeBenchmark.createConfig(); + ClientServerTopology.configure(config); + config.before(new CreatePartitionedRegion(), SERVER); + config.before(new CreateClientProxyRegion(), CLIENT); + config.before(new CreateIndexOnID(), SERVER); + config.before(new PrePopulateRegion(keyRange), SERVER); + config.workload(new OQLQuery(keyRange, queryRange), CLIENT); + return config; + } +} diff --git a/geode-benchmarks/src/main/java/org/apache/geode/benchmark/tests/PartitionedNonIndexedQueryBenchmark.java b/geode-benchmarks/src/main/java/org/apache/geode/benchmark/tests/PartitionedNonIndexedQueryBenchmark.java new file mode 100644 index 0000000..ec1133f --- /dev/null +++ b/geode-benchmarks/src/main/java/org/apache/geode/benchmark/tests/PartitionedNonIndexedQueryBenchmark.java @@ -0,0 +1,60 @@ +/* + * 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.tests; + +import static org.apache.geode.benchmark.topology.ClientServerTopology.Roles.CLIENT; +import static org.apache.geode.benchmark.topology.ClientServerTopology.Roles.SERVER; + +import org.junit.jupiter.api.Test; + +import org.apache.geode.benchmark.tasks.CreateClientProxyRegion; +import org.apache.geode.benchmark.tasks.CreatePartitionedRegion; +import org.apache.geode.benchmark.tasks.OQLQuery; +import org.apache.geode.benchmark.tasks.PrePopulateRegion; +import org.apache.geode.benchmark.topology.ClientServerTopology; +import org.apache.geode.perftest.PerformanceTest; +import org.apache.geode.perftest.TestConfig; +import org.apache.geode.perftest.TestRunners; + +public class PartitionedNonIndexedQueryBenchmark implements PerformanceTest { + private long keyRange = 500000; + private long queryRange = 1000; + + public PartitionedNonIndexedQueryBenchmark() {} + + public void setKeyRange(long keyRange) { + this.keyRange = keyRange; + } + + public void setQueryRange(long queryRange) { + this.queryRange = queryRange; + } + + @Test + public void run() throws Exception { + TestRunners.defaultRunner().runTest(this); + } + + @Override + public TestConfig configure() { + TestConfig config = GeodeBenchmark.createConfig(); + ClientServerTopology.configure(config); + config.before(new CreatePartitionedRegion(), SERVER); + config.before(new CreateClientProxyRegion(), CLIENT); + config.before(new PrePopulateRegion(keyRange), SERVER); + config.workload(new OQLQuery(keyRange, queryRange), CLIENT); + return config; + } +} diff --git a/geode-benchmarks/src/main/java/org/apache/geode/benchmark/tests/ReplicatedIndexedQueryBenchmark.java b/geode-benchmarks/src/main/java/org/apache/geode/benchmark/tests/ReplicatedIndexedQueryBenchmark.java new file mode 100644 index 0000000..d97dac1 --- /dev/null +++ b/geode-benchmarks/src/main/java/org/apache/geode/benchmark/tests/ReplicatedIndexedQueryBenchmark.java @@ -0,0 +1,62 @@ +/* + * 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.tests; + +import static org.apache.geode.benchmark.topology.ClientServerTopology.Roles.CLIENT; +import static org.apache.geode.benchmark.topology.ClientServerTopology.Roles.SERVER; + +import org.junit.jupiter.api.Test; + +import org.apache.geode.benchmark.tasks.CreateClientProxyRegion; +import org.apache.geode.benchmark.tasks.CreateIndexOnID; +import org.apache.geode.benchmark.tasks.CreateReplicatedRegion; +import org.apache.geode.benchmark.tasks.OQLQuery; +import org.apache.geode.benchmark.tasks.PrePopulateRegion; +import org.apache.geode.benchmark.topology.ClientServerTopology; +import org.apache.geode.perftest.PerformanceTest; +import org.apache.geode.perftest.TestConfig; +import org.apache.geode.perftest.TestRunners; + +public class ReplicatedIndexedQueryBenchmark implements PerformanceTest { + private long keyRange = 500000; + private long queryRange = 1000; + + public ReplicatedIndexedQueryBenchmark() {} + + public void setKeyRange(long keyRange) { + this.keyRange = keyRange; + } + + public void setQueryRange(long queryRange) { + this.queryRange = queryRange; + } + + @Test + public void run() throws Exception { + TestRunners.defaultRunner().runTest(this); + } + + @Override + public TestConfig configure() { + TestConfig config = GeodeBenchmark.createConfig(); + ClientServerTopology.configure(config); + config.before(new CreateReplicatedRegion(), SERVER); + config.before(new CreateClientProxyRegion(), CLIENT); + config.before(new CreateIndexOnID(), SERVER); + config.before(new PrePopulateRegion(keyRange), SERVER); + config.workload(new OQLQuery(keyRange, queryRange), CLIENT); + return config; + } +} diff --git a/geode-benchmarks/src/main/java/org/apache/geode/benchmark/tests/ReplicatedNonIndexedQueryBenchmark.java b/geode-benchmarks/src/main/java/org/apache/geode/benchmark/tests/ReplicatedNonIndexedQueryBenchmark.java new file mode 100644 index 0000000..6e93848 --- /dev/null +++ b/geode-benchmarks/src/main/java/org/apache/geode/benchmark/tests/ReplicatedNonIndexedQueryBenchmark.java @@ -0,0 +1,60 @@ +/* + * 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.tests; + +import static org.apache.geode.benchmark.topology.ClientServerTopology.Roles.CLIENT; +import static org.apache.geode.benchmark.topology.ClientServerTopology.Roles.SERVER; + +import org.junit.jupiter.api.Test; + +import org.apache.geode.benchmark.tasks.CreateClientProxyRegion; +import org.apache.geode.benchmark.tasks.CreateReplicatedRegion; +import org.apache.geode.benchmark.tasks.OQLQuery; +import org.apache.geode.benchmark.tasks.PrePopulateRegion; +import org.apache.geode.benchmark.topology.ClientServerTopology; +import org.apache.geode.perftest.PerformanceTest; +import org.apache.geode.perftest.TestConfig; +import org.apache.geode.perftest.TestRunners; + +public class ReplicatedNonIndexedQueryBenchmark implements PerformanceTest { + private long keyRange = 500000; + private long queryRange = 1000; + + public ReplicatedNonIndexedQueryBenchmark() {} + + public void setKeyRange(long keyRange) { + this.keyRange = keyRange; + } + + public void setQueryRange(long queryRange) { + this.queryRange = queryRange; + } + + @Test + public void run() throws Exception { + TestRunners.defaultRunner().runTest(this); + } + + @Override + public TestConfig configure() { + TestConfig config = GeodeBenchmark.createConfig(); + ClientServerTopology.configure(config); + config.before(new CreateReplicatedRegion(), SERVER); + config.before(new CreateClientProxyRegion(), CLIENT); + config.before(new PrePopulateRegion(keyRange), SERVER); + config.workload(new OQLQuery(keyRange, queryRange), CLIENT); + return config; + } +} diff --git a/geode-benchmarks/src/test/java/org/apache/geode/benchmark/tests/PartitionedIndexedQueryBenchmarkTest.java b/geode-benchmarks/src/test/java/org/apache/geode/benchmark/tests/PartitionedIndexedQueryBenchmarkTest.java new file mode 100644 index 0000000..552cc2f --- /dev/null +++ b/geode-benchmarks/src/test/java/org/apache/geode/benchmark/tests/PartitionedIndexedQueryBenchmarkTest.java @@ -0,0 +1,44 @@ +/* + * 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.tests; + +import java.io.File; +import java.nio.file.Path; + +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; +import org.junitpioneer.jupiter.TempDirectory; + +import org.apache.geode.perftest.TestRunners; + +@ExtendWith(TempDirectory.class) +public class PartitionedIndexedQueryBenchmarkTest { + private File folder; + + @BeforeEach + void createTemporaryFolder(@TempDirectory.TempDir Path tempFolder) { + folder = tempFolder.toFile(); + } + + @Test + public void benchmarkRunsSuccessfully() throws Exception { + PartitionedIndexedQueryBenchmark test = new PartitionedIndexedQueryBenchmark(); + test.setKeyRange(100); + test.setQueryRange(10); + TestRunners.minimalRunner(folder).runTest(test); + } + +} diff --git a/geode-benchmarks/src/test/java/org/apache/geode/benchmark/tests/PartitionedNonIndexedQueryBenchmarkTest.java b/geode-benchmarks/src/test/java/org/apache/geode/benchmark/tests/PartitionedNonIndexedQueryBenchmarkTest.java new file mode 100644 index 0000000..cceab9e --- /dev/null +++ b/geode-benchmarks/src/test/java/org/apache/geode/benchmark/tests/PartitionedNonIndexedQueryBenchmarkTest.java @@ -0,0 +1,44 @@ +/* + * 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.tests; + +import java.io.File; +import java.nio.file.Path; + +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; +import org.junitpioneer.jupiter.TempDirectory; + +import org.apache.geode.perftest.TestRunners; + +@ExtendWith(TempDirectory.class) +public class PartitionedNonIndexedQueryBenchmarkTest { + private File folder; + + @BeforeEach + void createTemporaryFolder(@TempDirectory.TempDir Path tempFolder) { + folder = tempFolder.toFile(); + } + + @Test + public void benchmarkRunsSuccessfully() throws Exception { + PartitionedNonIndexedQueryBenchmark test = new PartitionedNonIndexedQueryBenchmark(); + test.setKeyRange(100); + test.setQueryRange(10); + TestRunners.minimalRunner(folder).runTest(test); + } + +} diff --git a/geode-benchmarks/src/test/java/org/apache/geode/benchmark/tests/ReplicatedIndexedQueryBenchmarkTest.java b/geode-benchmarks/src/test/java/org/apache/geode/benchmark/tests/ReplicatedIndexedQueryBenchmarkTest.java new file mode 100644 index 0000000..3b39f24 --- /dev/null +++ b/geode-benchmarks/src/test/java/org/apache/geode/benchmark/tests/ReplicatedIndexedQueryBenchmarkTest.java @@ -0,0 +1,44 @@ +/* + * 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.tests; + +import java.io.File; +import java.nio.file.Path; + +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; +import org.junitpioneer.jupiter.TempDirectory; + +import org.apache.geode.perftest.TestRunners; + +@ExtendWith(TempDirectory.class) +public class ReplicatedIndexedQueryBenchmarkTest { + private File folder; + + @BeforeEach + void createTemporaryFolder(@TempDirectory.TempDir Path tempFolder) { + folder = tempFolder.toFile(); + } + + @Test + public void benchmarkRunsSuccessfully() throws Exception { + ReplicatedIndexedQueryBenchmark test = new ReplicatedIndexedQueryBenchmark(); + test.setKeyRange(100); + test.setQueryRange(10); + TestRunners.minimalRunner(folder).runTest(test); + } + +} diff --git a/geode-benchmarks/src/test/java/org/apache/geode/benchmark/tests/ReplicatedNonIndexedQueryBenchmarkTest.java b/geode-benchmarks/src/test/java/org/apache/geode/benchmark/tests/ReplicatedNonIndexedQueryBenchmarkTest.java new file mode 100644 index 0000000..416bdb3 --- /dev/null +++ b/geode-benchmarks/src/test/java/org/apache/geode/benchmark/tests/ReplicatedNonIndexedQueryBenchmarkTest.java @@ -0,0 +1,44 @@ +/* + * 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.tests; + +import java.io.File; +import java.nio.file.Path; + +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; +import org.junitpioneer.jupiter.TempDirectory; + +import org.apache.geode.perftest.TestRunners; + +@ExtendWith(TempDirectory.class) +public class ReplicatedNonIndexedQueryBenchmarkTest { + private File folder; + + @BeforeEach + void createTemporaryFolder(@TempDirectory.TempDir Path tempFolder) { + folder = tempFolder.toFile(); + } + + @Test + public void benchmarkRunsSuccessfully() throws Exception { + ReplicatedNonIndexedQueryBenchmark test = new ReplicatedNonIndexedQueryBenchmark(); + test.setKeyRange(100); + test.setQueryRange(10); + TestRunners.minimalRunner(folder).runTest(test); + } + +}