From 88985ca4f3da0119a75a963c6c85a05cf718649b Mon Sep 17 00:00:00 2001 From: Donal Evans Date: Mon, 19 Aug 2019 16:46:04 -0700 Subject: [PATCH] Added benchmarks for aggregate functions. --- .../benchmark/tasks/AggregateOQLQuery.java | 138 ++++++++++++++++++ .../AbstractPartitionedQueryBenchmark.java | 60 ++++++++ .../AbstractReplicatedQueryBenchmark.java | 60 ++++++++ ...onedIndexedAggregateQueryAvgBenchmark.java | 46 ++++++ ...xedAggregateQueryAvgDistinctBenchmark.java | 46 ++++++ ...edIndexedAggregateQueryCountBenchmark.java | 46 ++++++ ...dAggregateQueryCountDistinctBenchmark.java | 46 ++++++ ...onedIndexedAggregateQueryMaxBenchmark.java | 46 ++++++ ...onedIndexedAggregateQueryMinBenchmark.java | 46 ++++++ ...onedIndexedAggregateQuerySumBenchmark.java | 46 ++++++ ...xedAggregateQuerySumDistinctBenchmark.java | 46 ++++++ .../PartitionedIndexedQueryBenchmark.java | 27 +--- .../PartitionedNonIndexedQueryBenchmark.java | 28 +--- ...atedIndexedAggregateQueryAvgBenchmark.java | 46 ++++++ ...xedAggregateQueryAvgDistinctBenchmark.java | 46 ++++++ ...edIndexedAggregateQueryCountBenchmark.java | 46 ++++++ ...dAggregateQueryCountDistinctBenchmark.java | 46 ++++++ ...atedIndexedAggregateQueryMaxBenchmark.java | 46 ++++++ ...atedIndexedAggregateQueryMinBenchmark.java | 46 ++++++ ...atedIndexedAggregateQuerySumBenchmark.java | 46 ++++++ ...xedAggregateQuerySumDistinctBenchmark.java | 46 ++++++ .../ReplicatedIndexedQueryBenchmark.java | 27 +--- .../ReplicatedNonIndexedQueryBenchmark.java | 28 +--- ...IndexedAggregateQueryAvgBenchmarkTest.java | 46 ++++++ ...ggregateQueryAvgDistinctBenchmarkTest.java | 46 ++++++ ...dexedAggregateQueryCountBenchmarkTest.java | 46 ++++++ ...regateQueryCountDistinctBenchmarkTest.java | 46 ++++++ ...IndexedAggregateQueryMaxBenchmarkTest.java | 46 ++++++ ...IndexedAggregateQueryMinBenchmarkTest.java | 46 ++++++ ...IndexedAggregateQuerySumBenchmarkTest.java | 46 ++++++ ...ggregateQuerySumDistinctBenchmarkTest.java | 46 ++++++ ...IndexedAggregateQueryAvgBenchmarkTest.java | 46 ++++++ ...ggregateQueryAvgDistinctBenchmarkTest.java | 46 ++++++ ...dexedAggregateQueryCountBenchmarkTest.java | 46 ++++++ ...regateQueryCountDistinctBenchmarkTest.java | 46 ++++++ ...IndexedAggregateQueryMaxBenchmarkTest.java | 46 ++++++ ...IndexedAggregateQueryMinBenchmarkTest.java | 46 ++++++ ...IndexedAggregateQuerySumBenchmarkTest.java | 46 ++++++ ...ggregateQuerySumDistinctBenchmarkTest.java | 46 ++++++ 39 files changed, 1742 insertions(+), 98 deletions(-) create mode 100644 geode-benchmarks/src/main/java/org/apache/geode/benchmark/tasks/AggregateOQLQuery.java create mode 100644 geode-benchmarks/src/main/java/org/apache/geode/benchmark/tests/AbstractPartitionedQueryBenchmark.java create mode 100644 geode-benchmarks/src/main/java/org/apache/geode/benchmark/tests/AbstractReplicatedQueryBenchmark.java create mode 100644 geode-benchmarks/src/main/java/org/apache/geode/benchmark/tests/PartitionedIndexedAggregateQueryAvgBenchmark.java create mode 100644 geode-benchmarks/src/main/java/org/apache/geode/benchmark/tests/PartitionedIndexedAggregateQueryAvgDistinctBenchmark.java create mode 100644 geode-benchmarks/src/main/java/org/apache/geode/benchmark/tests/PartitionedIndexedAggregateQueryCountBenchmark.java create mode 100644 geode-benchmarks/src/main/java/org/apache/geode/benchmark/tests/PartitionedIndexedAggregateQueryCountDistinctBenchmark.java create mode 100644 geode-benchmarks/src/main/java/org/apache/geode/benchmark/tests/PartitionedIndexedAggregateQueryMaxBenchmark.java create mode 100644 geode-benchmarks/src/main/java/org/apache/geode/benchmark/tests/PartitionedIndexedAggregateQueryMinBenchmark.java create mode 100644 geode-benchmarks/src/main/java/org/apache/geode/benchmark/tests/PartitionedIndexedAggregateQuerySumBenchmark.java create mode 100644 geode-benchmarks/src/main/java/org/apache/geode/benchmark/tests/PartitionedIndexedAggregateQuerySumDistinctBenchmark.java create mode 100644 geode-benchmarks/src/main/java/org/apache/geode/benchmark/tests/ReplicatedIndexedAggregateQueryAvgBenchmark.java create mode 100644 geode-benchmarks/src/main/java/org/apache/geode/benchmark/tests/ReplicatedIndexedAggregateQueryAvgDistinctBenchmark.java create mode 100644 geode-benchmarks/src/main/java/org/apache/geode/benchmark/tests/ReplicatedIndexedAggregateQueryCountBenchmark.java create mode 100644 geode-benchmarks/src/main/java/org/apache/geode/benchmark/tests/ReplicatedIndexedAggregateQueryCountDistinctBenchmark.java create mode 100644 geode-benchmarks/src/main/java/org/apache/geode/benchmark/tests/ReplicatedIndexedAggregateQueryMaxBenchmark.java create mode 100644 geode-benchmarks/src/main/java/org/apache/geode/benchmark/tests/ReplicatedIndexedAggregateQueryMinBenchmark.java create mode 100644 geode-benchmarks/src/main/java/org/apache/geode/benchmark/tests/ReplicatedIndexedAggregateQuerySumBenchmark.java create mode 100644 geode-benchmarks/src/main/java/org/apache/geode/benchmark/tests/ReplicatedIndexedAggregateQuerySumDistinctBenchmark.java create mode 100644 geode-benchmarks/src/test/java/org/apache/geode/benchmark/tests/PartitionedIndexedAggregateQueryAvgBenchmarkTest.java create mode 100644 geode-benchmarks/src/test/java/org/apache/geode/benchmark/tests/PartitionedIndexedAggregateQueryAvgDistinctBenchmarkTest.java create mode 100644 geode-benchmarks/src/test/java/org/apache/geode/benchmark/tests/PartitionedIndexedAggregateQueryCountBenchmarkTest.java create mode 100644 geode-benchmarks/src/test/java/org/apache/geode/benchmark/tests/PartitionedIndexedAggregateQueryCountDistinctBenchmarkTest.java create mode 100644 geode-benchmarks/src/test/java/org/apache/geode/benchmark/tests/PartitionedIndexedAggregateQueryMaxBenchmarkTest.java create mode 100644 geode-benchmarks/src/test/java/org/apache/geode/benchmark/tests/PartitionedIndexedAggregateQueryMinBenchmarkTest.java create mode 100644 geode-benchmarks/src/test/java/org/apache/geode/benchmark/tests/PartitionedIndexedAggregateQuerySumBenchmarkTest.java create mode 100644 geode-benchmarks/src/test/java/org/apache/geode/benchmark/tests/PartitionedIndexedAggregateQuerySumDistinctBenchmarkTest.java create mode 100644 geode-benchmarks/src/test/java/org/apache/geode/benchmark/tests/ReplicatedIndexedAggregateQueryAvgBenchmarkTest.java create mode 100644 geode-benchmarks/src/test/java/org/apache/geode/benchmark/tests/ReplicatedIndexedAggregateQueryAvgDistinctBenchmarkTest.java create mode 100644 geode-benchmarks/src/test/java/org/apache/geode/benchmark/tests/ReplicatedIndexedAggregateQueryCountBenchmarkTest.java create mode 100644 geode-benchmarks/src/test/java/org/apache/geode/benchmark/tests/ReplicatedIndexedAggregateQueryCountDistinctBenchmarkTest.java create mode 100644 geode-benchmarks/src/test/java/org/apache/geode/benchmark/tests/ReplicatedIndexedAggregateQueryMaxBenchmarkTest.java create mode 100644 geode-benchmarks/src/test/java/org/apache/geode/benchmark/tests/ReplicatedIndexedAggregateQueryMinBenchmarkTest.java create mode 100644 geode-benchmarks/src/test/java/org/apache/geode/benchmark/tests/ReplicatedIndexedAggregateQuerySumBenchmarkTest.java create mode 100644 geode-benchmarks/src/test/java/org/apache/geode/benchmark/tests/ReplicatedIndexedAggregateQuerySumDistinctBenchmarkTest.java diff --git a/geode-benchmarks/src/main/java/org/apache/geode/benchmark/tasks/AggregateOQLQuery.java b/geode-benchmarks/src/main/java/org/apache/geode/benchmark/tasks/AggregateOQLQuery.java new file mode 100644 index 000000000..0e21c302e --- /dev/null +++ b/geode-benchmarks/src/main/java/org/apache/geode/benchmark/tasks/AggregateOQLQuery.java @@ -0,0 +1,138 @@ +/* + * 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 org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.yardstickframework.BenchmarkConfiguration; +import org.yardstickframework.BenchmarkDriverAdapter; + +import org.apache.geode.benchmark.LongRange; +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.Query; +import org.apache.geode.cache.query.SelectResults; +import org.apache.geode.perftest.jvms.RemoteJVMFactory; + +public class AggregateOQLQuery extends BenchmarkDriverAdapter implements Serializable { + + public static class QueryTypes { + public static final String SUM = "SUM("; + public static final String SUM_DISTINCT = "SUM(DISTINCT "; + public static final String AVG = "AVG("; + public static final String AVG_DISTINCT = "AVG(DISTINCT "; + public static final String COUNT = "COUNT("; + public static final String COUNT_DISTINCT = "COUNT(DISTINCT "; + public static final String MAX = "MAX("; + public static final String MIN = "MIN("; + } + + private static final Logger logger = LoggerFactory.getLogger(RemoteJVMFactory.class); + private Region region; + private LongRange keyRange; + private long queryRange; + private String type; + ClientCache cache; + private Query query; + + public AggregateOQLQuery(LongRange keyRange, long queryRange, String type) { + this.keyRange = keyRange; + this.queryRange = queryRange; + this.type = type; + } + + @Override + public void setUp(BenchmarkConfiguration cfg) throws Exception { + super.setUp(cfg); + cache = ClientCacheFactory.getAnyInstance(); + region = cache.getRegion("region"); + query = cache.getQueryService() + .newQuery("SELECT " + type + "r.ID) FROM /region r WHERE r.ID >= $1 AND r.ID <= $2"); + } + + @Override + public boolean test(Map ctx) throws Exception { + long minId = + ThreadLocalRandom.current().nextLong(keyRange.getMin(), keyRange.getMax() - 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 { + switch (type) { + case QueryTypes.SUM: + case QueryTypes.SUM_DISTINCT: + long sum = (int) results.asList().get(0); + long expectedSum = (maxId + minId) * (maxId - minId + 1) / 2; + if (sum != expectedSum) { + throw new Exception( + "Incorrect query result. Expected sum was " + expectedSum + ", actual sum was " + sum + + ". min =" + minId + " max =" + maxId + " range =" + queryRange); + } + break; + case QueryTypes.AVG: + case QueryTypes.AVG_DISTINCT: + long avg = (int) results.asList().get(0); + long expectedAvg = (maxId + minId) * (maxId - minId + 1) / ((queryRange + 1) * 2); + if (avg != expectedAvg) { + throw new Exception( + "Incorrect query result. Expected average was " + expectedAvg + + ", actual average was " + + avg + ". min =" + minId + " max =" + maxId + " range =" + queryRange); + } + break; + case QueryTypes.COUNT: + case QueryTypes.COUNT_DISTINCT: + long count = (int) results.asList().get(0); + if (count != queryRange + 1) { + throw new Exception( + "Incorrect query result. Expected count was " + queryRange + ", actual count was " + + count + ". min =" + minId + " max =" + maxId + " range =" + queryRange); + } + break; + case QueryTypes.MAX: + long max = (long) results.asList().get(0); + if (max != maxId) { + throw new Exception( + "Incorrect query result. Expected max was " + maxId + ", actual max was " + max + + ". min =" + minId + " max =" + maxId + " range =" + queryRange); + } + break; + case QueryTypes.MIN: + long min = (long) results.asList().get(0); + if (min != minId) { + throw new Exception( + "Incorrect query result. Expected min was " + minId + ", actual min was " + min + + ". min =" + minId + " max =" + maxId + " range =" + queryRange); + } + break; + default: + throw new Exception("Unsupported aggregate query type: " + type); + } + } + + private SelectResults executeQuery(long minId, long maxId) throws Exception { + return (SelectResults) query.execute(minId, maxId); + } +} diff --git a/geode-benchmarks/src/main/java/org/apache/geode/benchmark/tests/AbstractPartitionedQueryBenchmark.java b/geode-benchmarks/src/main/java/org/apache/geode/benchmark/tests/AbstractPartitionedQueryBenchmark.java new file mode 100644 index 000000000..d36de560b --- /dev/null +++ b/geode-benchmarks/src/main/java/org/apache/geode/benchmark/tests/AbstractPartitionedQueryBenchmark.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.apache.geode.benchmark.LongRange; +import org.apache.geode.benchmark.tasks.CreateClientProxyRegion; +import org.apache.geode.benchmark.tasks.CreatePartitionedRegion; +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; + +abstract class AbstractPartitionedQueryBenchmark implements PerformanceTest { + private LongRange keyRange = new LongRange(0, 500000); + private long queryRange = 100; + + public final void setKeyRange(LongRange keyRange) { + this.keyRange = keyRange; + } + + public final LongRange getKeyRange() { + return keyRange; + } + + public long getQueryRange() { + return queryRange; + } + + public void setQueryRange(long queryRange) { + this.queryRange = queryRange; + } + + @Override + public TestConfig configure() { + TestConfig config = GeodeBenchmark.createConfig(); + config.threads(Runtime.getRuntime().availableProcessors() * 8); + ClientServerTopology.configure(config); + config.before(new CreatePartitionedRegion(), SERVER); + config.before(new CreateClientProxyRegion(), CLIENT); + config.before(new PrePopulateRegion(keyRange), CLIENT); + return config; + } + +} diff --git a/geode-benchmarks/src/main/java/org/apache/geode/benchmark/tests/AbstractReplicatedQueryBenchmark.java b/geode-benchmarks/src/main/java/org/apache/geode/benchmark/tests/AbstractReplicatedQueryBenchmark.java new file mode 100644 index 000000000..4a9d97712 --- /dev/null +++ b/geode-benchmarks/src/main/java/org/apache/geode/benchmark/tests/AbstractReplicatedQueryBenchmark.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.apache.geode.benchmark.LongRange; +import org.apache.geode.benchmark.tasks.CreateClientProxyRegion; +import org.apache.geode.benchmark.tasks.CreateReplicatedRegion; +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; + +abstract class AbstractReplicatedQueryBenchmark implements PerformanceTest { + private LongRange keyRange = new LongRange(0, 500000); + private long queryRange = 100; + + public final void setKeyRange(LongRange keyRange) { + this.keyRange = keyRange; + } + + public final LongRange getKeyRange() { + return keyRange; + } + + public long getQueryRange() { + return queryRange; + } + + public void setQueryRange(long queryRange) { + this.queryRange = queryRange; + } + + @Override + public TestConfig configure() { + TestConfig config = GeodeBenchmark.createConfig(); + config.threads(Runtime.getRuntime().availableProcessors() * 8); + ClientServerTopology.configure(config); + config.before(new CreateReplicatedRegion(), SERVER); + config.before(new CreateClientProxyRegion(), CLIENT); + config.before(new PrePopulateRegion(keyRange), CLIENT); + return config; + } + +} diff --git a/geode-benchmarks/src/main/java/org/apache/geode/benchmark/tests/PartitionedIndexedAggregateQueryAvgBenchmark.java b/geode-benchmarks/src/main/java/org/apache/geode/benchmark/tests/PartitionedIndexedAggregateQueryAvgBenchmark.java new file mode 100644 index 000000000..a5f425342 --- /dev/null +++ b/geode-benchmarks/src/main/java/org/apache/geode/benchmark/tests/PartitionedIndexedAggregateQueryAvgBenchmark.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.tests; + +import static org.apache.geode.benchmark.tasks.AggregateOQLQuery.QueryTypes.AVG; +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.AggregateOQLQuery; +import org.apache.geode.benchmark.tasks.CreateIndexOnID; +import org.apache.geode.perftest.TestConfig; +import org.apache.geode.perftest.TestRunners; + +public class PartitionedIndexedAggregateQueryAvgBenchmark + extends AbstractPartitionedQueryBenchmark { + + public PartitionedIndexedAggregateQueryAvgBenchmark() {} + + @Test + public void run() throws Exception { + TestRunners.defaultRunner().runTest(this); + } + + @Override + public TestConfig configure() { + TestConfig config = super.configure(); + config.threads(Runtime.getRuntime().availableProcessors() * 1); + config.before(new CreateIndexOnID(), SERVER); + config.workload(new AggregateOQLQuery(getKeyRange(), 1000, AVG), CLIENT); + return config; + } +} diff --git a/geode-benchmarks/src/main/java/org/apache/geode/benchmark/tests/PartitionedIndexedAggregateQueryAvgDistinctBenchmark.java b/geode-benchmarks/src/main/java/org/apache/geode/benchmark/tests/PartitionedIndexedAggregateQueryAvgDistinctBenchmark.java new file mode 100644 index 000000000..fa25e2284 --- /dev/null +++ b/geode-benchmarks/src/main/java/org/apache/geode/benchmark/tests/PartitionedIndexedAggregateQueryAvgDistinctBenchmark.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.tests; + +import static org.apache.geode.benchmark.tasks.AggregateOQLQuery.QueryTypes.AVG_DISTINCT; +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.AggregateOQLQuery; +import org.apache.geode.benchmark.tasks.CreateIndexOnID; +import org.apache.geode.perftest.TestConfig; +import org.apache.geode.perftest.TestRunners; + +public class PartitionedIndexedAggregateQueryAvgDistinctBenchmark + extends AbstractPartitionedQueryBenchmark { + + public PartitionedIndexedAggregateQueryAvgDistinctBenchmark() {} + + @Test + public void run() throws Exception { + TestRunners.defaultRunner().runTest(this); + } + + @Override + public TestConfig configure() { + TestConfig config = super.configure(); + config.threads(Runtime.getRuntime().availableProcessors() * 1); + config.before(new CreateIndexOnID(), SERVER); + config.workload(new AggregateOQLQuery(getKeyRange(), getQueryRange(), AVG_DISTINCT), CLIENT); + return config; + } +} diff --git a/geode-benchmarks/src/main/java/org/apache/geode/benchmark/tests/PartitionedIndexedAggregateQueryCountBenchmark.java b/geode-benchmarks/src/main/java/org/apache/geode/benchmark/tests/PartitionedIndexedAggregateQueryCountBenchmark.java new file mode 100644 index 000000000..cac4519a9 --- /dev/null +++ b/geode-benchmarks/src/main/java/org/apache/geode/benchmark/tests/PartitionedIndexedAggregateQueryCountBenchmark.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.tests; + +import static org.apache.geode.benchmark.tasks.AggregateOQLQuery.QueryTypes.COUNT; +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.AggregateOQLQuery; +import org.apache.geode.benchmark.tasks.CreateIndexOnID; +import org.apache.geode.perftest.TestConfig; +import org.apache.geode.perftest.TestRunners; + +public class PartitionedIndexedAggregateQueryCountBenchmark + extends AbstractPartitionedQueryBenchmark { + + public PartitionedIndexedAggregateQueryCountBenchmark() {} + + @Test + public void run() throws Exception { + TestRunners.defaultRunner().runTest(this); + } + + @Override + public TestConfig configure() { + TestConfig config = super.configure(); + config.threads(Runtime.getRuntime().availableProcessors() * 1); + config.before(new CreateIndexOnID(), SERVER); + config.workload(new AggregateOQLQuery(getKeyRange(), getQueryRange(), COUNT), CLIENT); + return config; + } +} diff --git a/geode-benchmarks/src/main/java/org/apache/geode/benchmark/tests/PartitionedIndexedAggregateQueryCountDistinctBenchmark.java b/geode-benchmarks/src/main/java/org/apache/geode/benchmark/tests/PartitionedIndexedAggregateQueryCountDistinctBenchmark.java new file mode 100644 index 000000000..494550779 --- /dev/null +++ b/geode-benchmarks/src/main/java/org/apache/geode/benchmark/tests/PartitionedIndexedAggregateQueryCountDistinctBenchmark.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.tests; + +import static org.apache.geode.benchmark.tasks.AggregateOQLQuery.QueryTypes.COUNT_DISTINCT; +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.AggregateOQLQuery; +import org.apache.geode.benchmark.tasks.CreateIndexOnID; +import org.apache.geode.perftest.TestConfig; +import org.apache.geode.perftest.TestRunners; + +public class PartitionedIndexedAggregateQueryCountDistinctBenchmark + extends AbstractPartitionedQueryBenchmark { + + public PartitionedIndexedAggregateQueryCountDistinctBenchmark() {} + + @Test + public void run() throws Exception { + TestRunners.defaultRunner().runTest(this); + } + + @Override + public TestConfig configure() { + TestConfig config = super.configure(); + config.threads(Runtime.getRuntime().availableProcessors() * 1); + config.before(new CreateIndexOnID(), SERVER); + config.workload(new AggregateOQLQuery(getKeyRange(), getQueryRange(), COUNT_DISTINCT), CLIENT); + return config; + } +} diff --git a/geode-benchmarks/src/main/java/org/apache/geode/benchmark/tests/PartitionedIndexedAggregateQueryMaxBenchmark.java b/geode-benchmarks/src/main/java/org/apache/geode/benchmark/tests/PartitionedIndexedAggregateQueryMaxBenchmark.java new file mode 100644 index 000000000..13de5209a --- /dev/null +++ b/geode-benchmarks/src/main/java/org/apache/geode/benchmark/tests/PartitionedIndexedAggregateQueryMaxBenchmark.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.tests; + +import static org.apache.geode.benchmark.tasks.AggregateOQLQuery.QueryTypes.MAX; +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.AggregateOQLQuery; +import org.apache.geode.benchmark.tasks.CreateIndexOnID; +import org.apache.geode.perftest.TestConfig; +import org.apache.geode.perftest.TestRunners; + +public class PartitionedIndexedAggregateQueryMaxBenchmark + extends AbstractPartitionedQueryBenchmark { + + public PartitionedIndexedAggregateQueryMaxBenchmark() {} + + @Test + public void run() throws Exception { + TestRunners.defaultRunner().runTest(this); + } + + @Override + public TestConfig configure() { + TestConfig config = super.configure(); + config.threads(Runtime.getRuntime().availableProcessors() * 1); + config.before(new CreateIndexOnID(), SERVER); + config.workload(new AggregateOQLQuery(getKeyRange(), getQueryRange(), MAX), CLIENT); + return config; + } +} diff --git a/geode-benchmarks/src/main/java/org/apache/geode/benchmark/tests/PartitionedIndexedAggregateQueryMinBenchmark.java b/geode-benchmarks/src/main/java/org/apache/geode/benchmark/tests/PartitionedIndexedAggregateQueryMinBenchmark.java new file mode 100644 index 000000000..f893c7b62 --- /dev/null +++ b/geode-benchmarks/src/main/java/org/apache/geode/benchmark/tests/PartitionedIndexedAggregateQueryMinBenchmark.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.tests; + +import static org.apache.geode.benchmark.tasks.AggregateOQLQuery.QueryTypes.MIN; +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.AggregateOQLQuery; +import org.apache.geode.benchmark.tasks.CreateIndexOnID; +import org.apache.geode.perftest.TestConfig; +import org.apache.geode.perftest.TestRunners; + +public class PartitionedIndexedAggregateQueryMinBenchmark + extends AbstractPartitionedQueryBenchmark { + + public PartitionedIndexedAggregateQueryMinBenchmark() {} + + @Test + public void run() throws Exception { + TestRunners.defaultRunner().runTest(this); + } + + @Override + public TestConfig configure() { + TestConfig config = super.configure(); + config.threads(Runtime.getRuntime().availableProcessors() * 1); + config.before(new CreateIndexOnID(), SERVER); + config.workload(new AggregateOQLQuery(getKeyRange(), getQueryRange(), MIN), CLIENT); + return config; + } +} diff --git a/geode-benchmarks/src/main/java/org/apache/geode/benchmark/tests/PartitionedIndexedAggregateQuerySumBenchmark.java b/geode-benchmarks/src/main/java/org/apache/geode/benchmark/tests/PartitionedIndexedAggregateQuerySumBenchmark.java new file mode 100644 index 000000000..cf63ea15c --- /dev/null +++ b/geode-benchmarks/src/main/java/org/apache/geode/benchmark/tests/PartitionedIndexedAggregateQuerySumBenchmark.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.tests; + +import static org.apache.geode.benchmark.tasks.AggregateOQLQuery.QueryTypes.SUM; +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.AggregateOQLQuery; +import org.apache.geode.benchmark.tasks.CreateIndexOnID; +import org.apache.geode.perftest.TestConfig; +import org.apache.geode.perftest.TestRunners; + +public class PartitionedIndexedAggregateQuerySumBenchmark + extends AbstractPartitionedQueryBenchmark { + + public PartitionedIndexedAggregateQuerySumBenchmark() {} + + @Test + public void run() throws Exception { + TestRunners.defaultRunner().runTest(this); + } + + @Override + public TestConfig configure() { + TestConfig config = super.configure(); + config.threads(Runtime.getRuntime().availableProcessors() * 1); + config.before(new CreateIndexOnID(), SERVER); + config.workload(new AggregateOQLQuery(getKeyRange(), getQueryRange(), SUM), CLIENT); + return config; + } +} diff --git a/geode-benchmarks/src/main/java/org/apache/geode/benchmark/tests/PartitionedIndexedAggregateQuerySumDistinctBenchmark.java b/geode-benchmarks/src/main/java/org/apache/geode/benchmark/tests/PartitionedIndexedAggregateQuerySumDistinctBenchmark.java new file mode 100644 index 000000000..9846c1d1f --- /dev/null +++ b/geode-benchmarks/src/main/java/org/apache/geode/benchmark/tests/PartitionedIndexedAggregateQuerySumDistinctBenchmark.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.tests; + +import static org.apache.geode.benchmark.tasks.AggregateOQLQuery.QueryTypes.SUM_DISTINCT; +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.AggregateOQLQuery; +import org.apache.geode.benchmark.tasks.CreateIndexOnID; +import org.apache.geode.perftest.TestConfig; +import org.apache.geode.perftest.TestRunners; + +public class PartitionedIndexedAggregateQuerySumDistinctBenchmark + extends AbstractPartitionedQueryBenchmark { + + public PartitionedIndexedAggregateQuerySumDistinctBenchmark() {} + + @Test + public void run() throws Exception { + TestRunners.defaultRunner().runTest(this); + } + + @Override + public TestConfig configure() { + TestConfig config = super.configure(); + config.threads(Runtime.getRuntime().availableProcessors() * 1); + config.before(new CreateIndexOnID(), SERVER); + config.workload(new AggregateOQLQuery(getKeyRange(), getQueryRange(), SUM_DISTINCT), CLIENT); + return config; + } +} 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 index 470e74862..50b078a20 100644 --- 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 @@ -19,31 +19,15 @@ import org.junit.jupiter.api.Test; -import org.apache.geode.benchmark.LongRange; -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 LongRange keyRange = new LongRange(0, 500000); - private long queryRange = 100; +public class PartitionedIndexedQueryBenchmark extends AbstractPartitionedQueryBenchmark { public PartitionedIndexedQueryBenchmark() {} - public void setKeyRange(final LongRange keyRange) { - this.keyRange = keyRange; - } - - public void setQueryRange(final long queryRange) { - this.queryRange = queryRange; - } - @Test public void run() throws Exception { TestRunners.defaultRunner().runTest(this); @@ -51,14 +35,9 @@ public void run() throws Exception { @Override public TestConfig configure() { - TestConfig config = GeodeBenchmark.createConfig(); - config.threads(Runtime.getRuntime().availableProcessors() * 8); - ClientServerTopology.configure(config); - config.before(new CreatePartitionedRegion(), SERVER); - config.before(new CreateClientProxyRegion(), CLIENT); + TestConfig config = super.configure(); config.before(new CreateIndexOnID(), SERVER); - config.before(new PrePopulateRegion(keyRange), CLIENT); - config.workload(new OQLQuery(keyRange, queryRange), CLIENT); + config.workload(new OQLQuery(getKeyRange(), getQueryRange()), 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 index 1e7ded26f..9935c236f 100644 --- 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 @@ -15,34 +15,17 @@ 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.LongRange; -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 LongRange keyRange = new LongRange(0, 500000); - private long queryRange = 100; +public class PartitionedNonIndexedQueryBenchmark extends AbstractPartitionedQueryBenchmark { public PartitionedNonIndexedQueryBenchmark() {} - public void setKeyRange(final LongRange keyRange) { - this.keyRange = keyRange; - } - - public void setQueryRange(final long queryRange) { - this.queryRange = queryRange; - } - @Test public void run() throws Exception { TestRunners.defaultRunner().runTest(this); @@ -50,13 +33,8 @@ public void run() throws Exception { @Override public TestConfig configure() { - TestConfig config = GeodeBenchmark.createConfig(); - config.threads(Runtime.getRuntime().availableProcessors()); - ClientServerTopology.configure(config); - config.before(new CreatePartitionedRegion(), SERVER); - config.before(new CreateClientProxyRegion(), CLIENT); - config.before(new PrePopulateRegion(keyRange), CLIENT); - config.workload(new OQLQuery(keyRange, queryRange), CLIENT); + TestConfig config = super.configure(); + config.workload(new OQLQuery(getKeyRange(), getQueryRange()), CLIENT); return config; } } diff --git a/geode-benchmarks/src/main/java/org/apache/geode/benchmark/tests/ReplicatedIndexedAggregateQueryAvgBenchmark.java b/geode-benchmarks/src/main/java/org/apache/geode/benchmark/tests/ReplicatedIndexedAggregateQueryAvgBenchmark.java new file mode 100644 index 000000000..49ab4eb2a --- /dev/null +++ b/geode-benchmarks/src/main/java/org/apache/geode/benchmark/tests/ReplicatedIndexedAggregateQueryAvgBenchmark.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.tests; + +import static org.apache.geode.benchmark.tasks.AggregateOQLQuery.QueryTypes.AVG; +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.AggregateOQLQuery; +import org.apache.geode.benchmark.tasks.CreateIndexOnID; +import org.apache.geode.perftest.TestConfig; +import org.apache.geode.perftest.TestRunners; + +public class ReplicatedIndexedAggregateQueryAvgBenchmark + extends AbstractReplicatedQueryBenchmark { + + public ReplicatedIndexedAggregateQueryAvgBenchmark() {} + + @Test + public void run() throws Exception { + TestRunners.defaultRunner().runTest(this); + } + + @Override + public TestConfig configure() { + TestConfig config = super.configure(); + config.threads(Runtime.getRuntime().availableProcessors() * 1); + config.before(new CreateIndexOnID(), SERVER); + config.workload(new AggregateOQLQuery(getKeyRange(), getQueryRange(), AVG), CLIENT); + return config; + } +} diff --git a/geode-benchmarks/src/main/java/org/apache/geode/benchmark/tests/ReplicatedIndexedAggregateQueryAvgDistinctBenchmark.java b/geode-benchmarks/src/main/java/org/apache/geode/benchmark/tests/ReplicatedIndexedAggregateQueryAvgDistinctBenchmark.java new file mode 100644 index 000000000..191017aee --- /dev/null +++ b/geode-benchmarks/src/main/java/org/apache/geode/benchmark/tests/ReplicatedIndexedAggregateQueryAvgDistinctBenchmark.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.tests; + +import static org.apache.geode.benchmark.tasks.AggregateOQLQuery.QueryTypes.AVG_DISTINCT; +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.AggregateOQLQuery; +import org.apache.geode.benchmark.tasks.CreateIndexOnID; +import org.apache.geode.perftest.TestConfig; +import org.apache.geode.perftest.TestRunners; + +public class ReplicatedIndexedAggregateQueryAvgDistinctBenchmark + extends AbstractReplicatedQueryBenchmark { + + public ReplicatedIndexedAggregateQueryAvgDistinctBenchmark() {} + + @Test + public void run() throws Exception { + TestRunners.defaultRunner().runTest(this); + } + + @Override + public TestConfig configure() { + TestConfig config = super.configure(); + config.threads(Runtime.getRuntime().availableProcessors() * 1); + config.before(new CreateIndexOnID(), SERVER); + config.workload(new AggregateOQLQuery(getKeyRange(), getQueryRange(), AVG_DISTINCT), CLIENT); + return config; + } +} diff --git a/geode-benchmarks/src/main/java/org/apache/geode/benchmark/tests/ReplicatedIndexedAggregateQueryCountBenchmark.java b/geode-benchmarks/src/main/java/org/apache/geode/benchmark/tests/ReplicatedIndexedAggregateQueryCountBenchmark.java new file mode 100644 index 000000000..040997770 --- /dev/null +++ b/geode-benchmarks/src/main/java/org/apache/geode/benchmark/tests/ReplicatedIndexedAggregateQueryCountBenchmark.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.tests; + +import static org.apache.geode.benchmark.tasks.AggregateOQLQuery.QueryTypes.COUNT; +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.AggregateOQLQuery; +import org.apache.geode.benchmark.tasks.CreateIndexOnID; +import org.apache.geode.perftest.TestConfig; +import org.apache.geode.perftest.TestRunners; + +public class ReplicatedIndexedAggregateQueryCountBenchmark + extends AbstractReplicatedQueryBenchmark { + + public ReplicatedIndexedAggregateQueryCountBenchmark() {} + + @Test + public void run() throws Exception { + TestRunners.defaultRunner().runTest(this); + } + + @Override + public TestConfig configure() { + TestConfig config = super.configure(); + config.threads(Runtime.getRuntime().availableProcessors() * 1); + config.before(new CreateIndexOnID(), SERVER); + config.workload(new AggregateOQLQuery(getKeyRange(), getQueryRange(), COUNT), CLIENT); + return config; + } +} diff --git a/geode-benchmarks/src/main/java/org/apache/geode/benchmark/tests/ReplicatedIndexedAggregateQueryCountDistinctBenchmark.java b/geode-benchmarks/src/main/java/org/apache/geode/benchmark/tests/ReplicatedIndexedAggregateQueryCountDistinctBenchmark.java new file mode 100644 index 000000000..0d28e328b --- /dev/null +++ b/geode-benchmarks/src/main/java/org/apache/geode/benchmark/tests/ReplicatedIndexedAggregateQueryCountDistinctBenchmark.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.tests; + +import static org.apache.geode.benchmark.tasks.AggregateOQLQuery.QueryTypes.COUNT_DISTINCT; +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.AggregateOQLQuery; +import org.apache.geode.benchmark.tasks.CreateIndexOnID; +import org.apache.geode.perftest.TestConfig; +import org.apache.geode.perftest.TestRunners; + +public class ReplicatedIndexedAggregateQueryCountDistinctBenchmark + extends AbstractReplicatedQueryBenchmark { + + public ReplicatedIndexedAggregateQueryCountDistinctBenchmark() {} + + @Test + public void run() throws Exception { + TestRunners.defaultRunner().runTest(this); + } + + @Override + public TestConfig configure() { + TestConfig config = super.configure(); + config.threads(Runtime.getRuntime().availableProcessors() * 1); + config.before(new CreateIndexOnID(), SERVER); + config.workload(new AggregateOQLQuery(getKeyRange(), getQueryRange(), COUNT_DISTINCT), CLIENT); + return config; + } +} diff --git a/geode-benchmarks/src/main/java/org/apache/geode/benchmark/tests/ReplicatedIndexedAggregateQueryMaxBenchmark.java b/geode-benchmarks/src/main/java/org/apache/geode/benchmark/tests/ReplicatedIndexedAggregateQueryMaxBenchmark.java new file mode 100644 index 000000000..a4da5bd25 --- /dev/null +++ b/geode-benchmarks/src/main/java/org/apache/geode/benchmark/tests/ReplicatedIndexedAggregateQueryMaxBenchmark.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.tests; + +import static org.apache.geode.benchmark.tasks.AggregateOQLQuery.QueryTypes.MAX; +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.AggregateOQLQuery; +import org.apache.geode.benchmark.tasks.CreateIndexOnID; +import org.apache.geode.perftest.TestConfig; +import org.apache.geode.perftest.TestRunners; + +public class ReplicatedIndexedAggregateQueryMaxBenchmark + extends AbstractReplicatedQueryBenchmark { + + public ReplicatedIndexedAggregateQueryMaxBenchmark() {} + + @Test + public void run() throws Exception { + TestRunners.defaultRunner().runTest(this); + } + + @Override + public TestConfig configure() { + TestConfig config = super.configure(); + config.threads(Runtime.getRuntime().availableProcessors() * 1); + config.before(new CreateIndexOnID(), SERVER); + config.workload(new AggregateOQLQuery(getKeyRange(), getQueryRange(), MAX), CLIENT); + return config; + } +} diff --git a/geode-benchmarks/src/main/java/org/apache/geode/benchmark/tests/ReplicatedIndexedAggregateQueryMinBenchmark.java b/geode-benchmarks/src/main/java/org/apache/geode/benchmark/tests/ReplicatedIndexedAggregateQueryMinBenchmark.java new file mode 100644 index 000000000..ac000f918 --- /dev/null +++ b/geode-benchmarks/src/main/java/org/apache/geode/benchmark/tests/ReplicatedIndexedAggregateQueryMinBenchmark.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.tests; + +import static org.apache.geode.benchmark.tasks.AggregateOQLQuery.QueryTypes.MIN; +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.AggregateOQLQuery; +import org.apache.geode.benchmark.tasks.CreateIndexOnID; +import org.apache.geode.perftest.TestConfig; +import org.apache.geode.perftest.TestRunners; + +public class ReplicatedIndexedAggregateQueryMinBenchmark + extends AbstractReplicatedQueryBenchmark { + + public ReplicatedIndexedAggregateQueryMinBenchmark() {} + + @Test + public void run() throws Exception { + TestRunners.defaultRunner().runTest(this); + } + + @Override + public TestConfig configure() { + TestConfig config = super.configure(); + config.threads(Runtime.getRuntime().availableProcessors() * 1); + config.before(new CreateIndexOnID(), SERVER); + config.workload(new AggregateOQLQuery(getKeyRange(), getQueryRange(), MIN), CLIENT); + return config; + } +} diff --git a/geode-benchmarks/src/main/java/org/apache/geode/benchmark/tests/ReplicatedIndexedAggregateQuerySumBenchmark.java b/geode-benchmarks/src/main/java/org/apache/geode/benchmark/tests/ReplicatedIndexedAggregateQuerySumBenchmark.java new file mode 100644 index 000000000..e5087d246 --- /dev/null +++ b/geode-benchmarks/src/main/java/org/apache/geode/benchmark/tests/ReplicatedIndexedAggregateQuerySumBenchmark.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.tests; + +import static org.apache.geode.benchmark.tasks.AggregateOQLQuery.QueryTypes.SUM; +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.AggregateOQLQuery; +import org.apache.geode.benchmark.tasks.CreateIndexOnID; +import org.apache.geode.perftest.TestConfig; +import org.apache.geode.perftest.TestRunners; + +public class ReplicatedIndexedAggregateQuerySumBenchmark + extends AbstractReplicatedQueryBenchmark { + + public ReplicatedIndexedAggregateQuerySumBenchmark() {} + + @Test + public void run() throws Exception { + TestRunners.defaultRunner().runTest(this); + } + + @Override + public TestConfig configure() { + TestConfig config = super.configure(); + config.threads(Runtime.getRuntime().availableProcessors() * 1); + config.before(new CreateIndexOnID(), SERVER); + config.workload(new AggregateOQLQuery(getKeyRange(), getQueryRange(), SUM), CLIENT); + return config; + } +} diff --git a/geode-benchmarks/src/main/java/org/apache/geode/benchmark/tests/ReplicatedIndexedAggregateQuerySumDistinctBenchmark.java b/geode-benchmarks/src/main/java/org/apache/geode/benchmark/tests/ReplicatedIndexedAggregateQuerySumDistinctBenchmark.java new file mode 100644 index 000000000..6ba8e7915 --- /dev/null +++ b/geode-benchmarks/src/main/java/org/apache/geode/benchmark/tests/ReplicatedIndexedAggregateQuerySumDistinctBenchmark.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.tests; + +import static org.apache.geode.benchmark.tasks.AggregateOQLQuery.QueryTypes.SUM_DISTINCT; +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.AggregateOQLQuery; +import org.apache.geode.benchmark.tasks.CreateIndexOnID; +import org.apache.geode.perftest.TestConfig; +import org.apache.geode.perftest.TestRunners; + +public class ReplicatedIndexedAggregateQuerySumDistinctBenchmark + extends AbstractReplicatedQueryBenchmark { + + public ReplicatedIndexedAggregateQuerySumDistinctBenchmark() {} + + @Test + public void run() throws Exception { + TestRunners.defaultRunner().runTest(this); + } + + @Override + public TestConfig configure() { + TestConfig config = super.configure(); + config.threads(Runtime.getRuntime().availableProcessors() * 1); + config.before(new CreateIndexOnID(), SERVER); + config.workload(new AggregateOQLQuery(getKeyRange(), getQueryRange(), SUM_DISTINCT), 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 index 23ca659e0..e1f41ac35 100644 --- 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 @@ -19,31 +19,15 @@ import org.junit.jupiter.api.Test; -import org.apache.geode.benchmark.LongRange; -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 LongRange keyRange = new LongRange(0, 500000); - private long queryRange = 100; +public class ReplicatedIndexedQueryBenchmark extends AbstractReplicatedQueryBenchmark { public ReplicatedIndexedQueryBenchmark() {} - public void setKeyRange(final LongRange keyRange) { - this.keyRange = keyRange; - } - - public void setQueryRange(final long queryRange) { - this.queryRange = queryRange; - } - @Test public void run() throws Exception { TestRunners.defaultRunner().runTest(this); @@ -51,14 +35,9 @@ public void run() throws Exception { @Override public TestConfig configure() { - TestConfig config = GeodeBenchmark.createConfig(); - config.threads(Runtime.getRuntime().availableProcessors() * 8); - ClientServerTopology.configure(config); - config.before(new CreateReplicatedRegion(), SERVER); - config.before(new CreateClientProxyRegion(), CLIENT); + TestConfig config = super.configure(); config.before(new CreateIndexOnID(), SERVER); - config.before(new PrePopulateRegion(keyRange), CLIENT); - config.workload(new OQLQuery(keyRange, queryRange), CLIENT); + config.workload(new OQLQuery(getKeyRange(), getQueryRange()), 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 index ac2e167c7..64b28b5c0 100644 --- 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 @@ -15,34 +15,17 @@ 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.LongRange; -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 LongRange keyRange = new LongRange(0, 500000); - private long queryRange = 100; +public class ReplicatedNonIndexedQueryBenchmark extends AbstractReplicatedQueryBenchmark { public ReplicatedNonIndexedQueryBenchmark() {} - public void setKeyRange(LongRange keyRange) { - this.keyRange = keyRange; - } - - public void setQueryRange(long queryRange) { - this.queryRange = queryRange; - } - @Test public void run() throws Exception { TestRunners.defaultRunner().runTest(this); @@ -50,13 +33,8 @@ public void run() throws Exception { @Override public TestConfig configure() { - TestConfig config = GeodeBenchmark.createConfig(); - config.threads(Runtime.getRuntime().availableProcessors()); - ClientServerTopology.configure(config); - config.before(new CreateReplicatedRegion(), SERVER); - config.before(new CreateClientProxyRegion(), CLIENT); - config.before(new PrePopulateRegion(keyRange), CLIENT); - config.workload(new OQLQuery(keyRange, queryRange), CLIENT); + TestConfig config = super.configure(); + config.workload(new OQLQuery(getKeyRange(), getQueryRange()), CLIENT); return config; } } diff --git a/geode-benchmarks/src/test/java/org/apache/geode/benchmark/tests/PartitionedIndexedAggregateQueryAvgBenchmarkTest.java b/geode-benchmarks/src/test/java/org/apache/geode/benchmark/tests/PartitionedIndexedAggregateQueryAvgBenchmarkTest.java new file mode 100644 index 000000000..bf2ca5b99 --- /dev/null +++ b/geode-benchmarks/src/test/java/org/apache/geode/benchmark/tests/PartitionedIndexedAggregateQueryAvgBenchmarkTest.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.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.benchmark.LongRange; +import org.apache.geode.perftest.TestRunners; + +@ExtendWith(TempDirectory.class) +public class PartitionedIndexedAggregateQueryAvgBenchmarkTest { + private File folder; + + @BeforeEach + void createTemporaryFolder(@TempDirectory.TempDir Path tempFolder) { + folder = tempFolder.toFile(); + } + + @Test + public void benchmarkRunsSuccessfully() throws Exception { + PartitionedIndexedAggregateQueryAvgBenchmark test = + new PartitionedIndexedAggregateQueryAvgBenchmark(); + test.setKeyRange(new LongRange(0, 100)); + test.setQueryRange(10); + TestRunners.minimalRunner(folder).runTest(test); + } + +} diff --git a/geode-benchmarks/src/test/java/org/apache/geode/benchmark/tests/PartitionedIndexedAggregateQueryAvgDistinctBenchmarkTest.java b/geode-benchmarks/src/test/java/org/apache/geode/benchmark/tests/PartitionedIndexedAggregateQueryAvgDistinctBenchmarkTest.java new file mode 100644 index 000000000..e4f0b0df6 --- /dev/null +++ b/geode-benchmarks/src/test/java/org/apache/geode/benchmark/tests/PartitionedIndexedAggregateQueryAvgDistinctBenchmarkTest.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.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.benchmark.LongRange; +import org.apache.geode.perftest.TestRunners; + +@ExtendWith(TempDirectory.class) +public class PartitionedIndexedAggregateQueryAvgDistinctBenchmarkTest { + private File folder; + + @BeforeEach + void createTemporaryFolder(@TempDirectory.TempDir Path tempFolder) { + folder = tempFolder.toFile(); + } + + @Test + public void benchmarkRunsSuccessfully() throws Exception { + PartitionedIndexedAggregateQueryAvgDistinctBenchmark test = + new PartitionedIndexedAggregateQueryAvgDistinctBenchmark(); + test.setKeyRange(new LongRange(0, 100)); + test.setQueryRange(10); + TestRunners.minimalRunner(folder).runTest(test); + } + +} diff --git a/geode-benchmarks/src/test/java/org/apache/geode/benchmark/tests/PartitionedIndexedAggregateQueryCountBenchmarkTest.java b/geode-benchmarks/src/test/java/org/apache/geode/benchmark/tests/PartitionedIndexedAggregateQueryCountBenchmarkTest.java new file mode 100644 index 000000000..280ee2188 --- /dev/null +++ b/geode-benchmarks/src/test/java/org/apache/geode/benchmark/tests/PartitionedIndexedAggregateQueryCountBenchmarkTest.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.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.benchmark.LongRange; +import org.apache.geode.perftest.TestRunners; + +@ExtendWith(TempDirectory.class) +public class PartitionedIndexedAggregateQueryCountBenchmarkTest { + private File folder; + + @BeforeEach + void createTemporaryFolder(@TempDirectory.TempDir Path tempFolder) { + folder = tempFolder.toFile(); + } + + @Test + public void benchmarkRunsSuccessfully() throws Exception { + PartitionedIndexedAggregateQueryCountBenchmark test = + new PartitionedIndexedAggregateQueryCountBenchmark(); + test.setKeyRange(new LongRange(0, 100)); + test.setQueryRange(10); + TestRunners.minimalRunner(folder).runTest(test); + } + +} diff --git a/geode-benchmarks/src/test/java/org/apache/geode/benchmark/tests/PartitionedIndexedAggregateQueryCountDistinctBenchmarkTest.java b/geode-benchmarks/src/test/java/org/apache/geode/benchmark/tests/PartitionedIndexedAggregateQueryCountDistinctBenchmarkTest.java new file mode 100644 index 000000000..82da0a097 --- /dev/null +++ b/geode-benchmarks/src/test/java/org/apache/geode/benchmark/tests/PartitionedIndexedAggregateQueryCountDistinctBenchmarkTest.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.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.benchmark.LongRange; +import org.apache.geode.perftest.TestRunners; + +@ExtendWith(TempDirectory.class) +public class PartitionedIndexedAggregateQueryCountDistinctBenchmarkTest { + private File folder; + + @BeforeEach + void createTemporaryFolder(@TempDirectory.TempDir Path tempFolder) { + folder = tempFolder.toFile(); + } + + @Test + public void benchmarkRunsSuccessfully() throws Exception { + PartitionedIndexedAggregateQueryCountDistinctBenchmark test = + new PartitionedIndexedAggregateQueryCountDistinctBenchmark(); + test.setKeyRange(new LongRange(0, 100)); + test.setQueryRange(10); + TestRunners.minimalRunner(folder).runTest(test); + } + +} diff --git a/geode-benchmarks/src/test/java/org/apache/geode/benchmark/tests/PartitionedIndexedAggregateQueryMaxBenchmarkTest.java b/geode-benchmarks/src/test/java/org/apache/geode/benchmark/tests/PartitionedIndexedAggregateQueryMaxBenchmarkTest.java new file mode 100644 index 000000000..49acd3d6d --- /dev/null +++ b/geode-benchmarks/src/test/java/org/apache/geode/benchmark/tests/PartitionedIndexedAggregateQueryMaxBenchmarkTest.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.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.benchmark.LongRange; +import org.apache.geode.perftest.TestRunners; + +@ExtendWith(TempDirectory.class) +public class PartitionedIndexedAggregateQueryMaxBenchmarkTest { + private File folder; + + @BeforeEach + void createTemporaryFolder(@TempDirectory.TempDir Path tempFolder) { + folder = tempFolder.toFile(); + } + + @Test + public void benchmarkRunsSuccessfully() throws Exception { + PartitionedIndexedAggregateQueryMaxBenchmark test = + new PartitionedIndexedAggregateQueryMaxBenchmark(); + test.setKeyRange(new LongRange(0, 100)); + test.setQueryRange(10); + TestRunners.minimalRunner(folder).runTest(test); + } + +} diff --git a/geode-benchmarks/src/test/java/org/apache/geode/benchmark/tests/PartitionedIndexedAggregateQueryMinBenchmarkTest.java b/geode-benchmarks/src/test/java/org/apache/geode/benchmark/tests/PartitionedIndexedAggregateQueryMinBenchmarkTest.java new file mode 100644 index 000000000..8a2c46e5d --- /dev/null +++ b/geode-benchmarks/src/test/java/org/apache/geode/benchmark/tests/PartitionedIndexedAggregateQueryMinBenchmarkTest.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.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.benchmark.LongRange; +import org.apache.geode.perftest.TestRunners; + +@ExtendWith(TempDirectory.class) +public class PartitionedIndexedAggregateQueryMinBenchmarkTest { + private File folder; + + @BeforeEach + void createTemporaryFolder(@TempDirectory.TempDir Path tempFolder) { + folder = tempFolder.toFile(); + } + + @Test + public void benchmarkRunsSuccessfully() throws Exception { + PartitionedIndexedAggregateQueryMinBenchmark test = + new PartitionedIndexedAggregateQueryMinBenchmark(); + test.setKeyRange(new LongRange(0, 100)); + test.setQueryRange(10); + TestRunners.minimalRunner(folder).runTest(test); + } + +} diff --git a/geode-benchmarks/src/test/java/org/apache/geode/benchmark/tests/PartitionedIndexedAggregateQuerySumBenchmarkTest.java b/geode-benchmarks/src/test/java/org/apache/geode/benchmark/tests/PartitionedIndexedAggregateQuerySumBenchmarkTest.java new file mode 100644 index 000000000..d3e02a157 --- /dev/null +++ b/geode-benchmarks/src/test/java/org/apache/geode/benchmark/tests/PartitionedIndexedAggregateQuerySumBenchmarkTest.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.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.benchmark.LongRange; +import org.apache.geode.perftest.TestRunners; + +@ExtendWith(TempDirectory.class) +public class PartitionedIndexedAggregateQuerySumBenchmarkTest { + private File folder; + + @BeforeEach + void createTemporaryFolder(@TempDirectory.TempDir Path tempFolder) { + folder = tempFolder.toFile(); + } + + @Test + public void benchmarkRunsSuccessfully() throws Exception { + PartitionedIndexedAggregateQuerySumBenchmark test = + new PartitionedIndexedAggregateQuerySumBenchmark(); + test.setKeyRange(new LongRange(0, 100)); + test.setQueryRange(10); + TestRunners.minimalRunner(folder).runTest(test); + } + +} diff --git a/geode-benchmarks/src/test/java/org/apache/geode/benchmark/tests/PartitionedIndexedAggregateQuerySumDistinctBenchmarkTest.java b/geode-benchmarks/src/test/java/org/apache/geode/benchmark/tests/PartitionedIndexedAggregateQuerySumDistinctBenchmarkTest.java new file mode 100644 index 000000000..6c25776c6 --- /dev/null +++ b/geode-benchmarks/src/test/java/org/apache/geode/benchmark/tests/PartitionedIndexedAggregateQuerySumDistinctBenchmarkTest.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.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.benchmark.LongRange; +import org.apache.geode.perftest.TestRunners; + +@ExtendWith(TempDirectory.class) +public class PartitionedIndexedAggregateQuerySumDistinctBenchmarkTest { + private File folder; + + @BeforeEach + void createTemporaryFolder(@TempDirectory.TempDir Path tempFolder) { + folder = tempFolder.toFile(); + } + + @Test + public void benchmarkRunsSuccessfully() throws Exception { + PartitionedIndexedAggregateQuerySumDistinctBenchmark test = + new PartitionedIndexedAggregateQuerySumDistinctBenchmark(); + test.setKeyRange(new LongRange(0, 100)); + test.setQueryRange(10); + TestRunners.minimalRunner(folder).runTest(test); + } + +} diff --git a/geode-benchmarks/src/test/java/org/apache/geode/benchmark/tests/ReplicatedIndexedAggregateQueryAvgBenchmarkTest.java b/geode-benchmarks/src/test/java/org/apache/geode/benchmark/tests/ReplicatedIndexedAggregateQueryAvgBenchmarkTest.java new file mode 100644 index 000000000..fd25e3cf8 --- /dev/null +++ b/geode-benchmarks/src/test/java/org/apache/geode/benchmark/tests/ReplicatedIndexedAggregateQueryAvgBenchmarkTest.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.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.benchmark.LongRange; +import org.apache.geode.perftest.TestRunners; + +@ExtendWith(TempDirectory.class) +public class ReplicatedIndexedAggregateQueryAvgBenchmarkTest { + private File folder; + + @BeforeEach + void createTemporaryFolder(@TempDirectory.TempDir Path tempFolder) { + folder = tempFolder.toFile(); + } + + @Test + public void benchmarkRunsSuccessfully() throws Exception { + ReplicatedIndexedAggregateQueryAvgBenchmark test = + new ReplicatedIndexedAggregateQueryAvgBenchmark(); + test.setKeyRange(new LongRange(0, 100)); + test.setQueryRange(10); + TestRunners.minimalRunner(folder).runTest(test); + } + +} diff --git a/geode-benchmarks/src/test/java/org/apache/geode/benchmark/tests/ReplicatedIndexedAggregateQueryAvgDistinctBenchmarkTest.java b/geode-benchmarks/src/test/java/org/apache/geode/benchmark/tests/ReplicatedIndexedAggregateQueryAvgDistinctBenchmarkTest.java new file mode 100644 index 000000000..1209df2a9 --- /dev/null +++ b/geode-benchmarks/src/test/java/org/apache/geode/benchmark/tests/ReplicatedIndexedAggregateQueryAvgDistinctBenchmarkTest.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.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.benchmark.LongRange; +import org.apache.geode.perftest.TestRunners; + +@ExtendWith(TempDirectory.class) +public class ReplicatedIndexedAggregateQueryAvgDistinctBenchmarkTest { + private File folder; + + @BeforeEach + void createTemporaryFolder(@TempDirectory.TempDir Path tempFolder) { + folder = tempFolder.toFile(); + } + + @Test + public void benchmarkRunsSuccessfully() throws Exception { + ReplicatedIndexedAggregateQueryAvgDistinctBenchmark test = + new ReplicatedIndexedAggregateQueryAvgDistinctBenchmark(); + test.setKeyRange(new LongRange(0, 100)); + test.setQueryRange(10); + TestRunners.minimalRunner(folder).runTest(test); + } + +} diff --git a/geode-benchmarks/src/test/java/org/apache/geode/benchmark/tests/ReplicatedIndexedAggregateQueryCountBenchmarkTest.java b/geode-benchmarks/src/test/java/org/apache/geode/benchmark/tests/ReplicatedIndexedAggregateQueryCountBenchmarkTest.java new file mode 100644 index 000000000..09021b713 --- /dev/null +++ b/geode-benchmarks/src/test/java/org/apache/geode/benchmark/tests/ReplicatedIndexedAggregateQueryCountBenchmarkTest.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.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.benchmark.LongRange; +import org.apache.geode.perftest.TestRunners; + +@ExtendWith(TempDirectory.class) +public class ReplicatedIndexedAggregateQueryCountBenchmarkTest { + private File folder; + + @BeforeEach + void createTemporaryFolder(@TempDirectory.TempDir Path tempFolder) { + folder = tempFolder.toFile(); + } + + @Test + public void benchmarkRunsSuccessfully() throws Exception { + ReplicatedIndexedAggregateQueryCountBenchmark test = + new ReplicatedIndexedAggregateQueryCountBenchmark(); + test.setKeyRange(new LongRange(0, 100)); + test.setQueryRange(10); + TestRunners.minimalRunner(folder).runTest(test); + } + +} diff --git a/geode-benchmarks/src/test/java/org/apache/geode/benchmark/tests/ReplicatedIndexedAggregateQueryCountDistinctBenchmarkTest.java b/geode-benchmarks/src/test/java/org/apache/geode/benchmark/tests/ReplicatedIndexedAggregateQueryCountDistinctBenchmarkTest.java new file mode 100644 index 000000000..09982dd42 --- /dev/null +++ b/geode-benchmarks/src/test/java/org/apache/geode/benchmark/tests/ReplicatedIndexedAggregateQueryCountDistinctBenchmarkTest.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.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.benchmark.LongRange; +import org.apache.geode.perftest.TestRunners; + +@ExtendWith(TempDirectory.class) +public class ReplicatedIndexedAggregateQueryCountDistinctBenchmarkTest { + private File folder; + + @BeforeEach + void createTemporaryFolder(@TempDirectory.TempDir Path tempFolder) { + folder = tempFolder.toFile(); + } + + @Test + public void benchmarkRunsSuccessfully() throws Exception { + ReplicatedIndexedAggregateQueryCountDistinctBenchmark test = + new ReplicatedIndexedAggregateQueryCountDistinctBenchmark(); + test.setKeyRange(new LongRange(0, 100)); + test.setQueryRange(10); + TestRunners.minimalRunner(folder).runTest(test); + } + +} diff --git a/geode-benchmarks/src/test/java/org/apache/geode/benchmark/tests/ReplicatedIndexedAggregateQueryMaxBenchmarkTest.java b/geode-benchmarks/src/test/java/org/apache/geode/benchmark/tests/ReplicatedIndexedAggregateQueryMaxBenchmarkTest.java new file mode 100644 index 000000000..45a25ce90 --- /dev/null +++ b/geode-benchmarks/src/test/java/org/apache/geode/benchmark/tests/ReplicatedIndexedAggregateQueryMaxBenchmarkTest.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.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.benchmark.LongRange; +import org.apache.geode.perftest.TestRunners; + +@ExtendWith(TempDirectory.class) +public class ReplicatedIndexedAggregateQueryMaxBenchmarkTest { + private File folder; + + @BeforeEach + void createTemporaryFolder(@TempDirectory.TempDir Path tempFolder) { + folder = tempFolder.toFile(); + } + + @Test + public void benchmarkRunsSuccessfully() throws Exception { + ReplicatedIndexedAggregateQueryMaxBenchmark test = + new ReplicatedIndexedAggregateQueryMaxBenchmark(); + test.setKeyRange(new LongRange(0, 100)); + test.setQueryRange(10); + TestRunners.minimalRunner(folder).runTest(test); + } + +} diff --git a/geode-benchmarks/src/test/java/org/apache/geode/benchmark/tests/ReplicatedIndexedAggregateQueryMinBenchmarkTest.java b/geode-benchmarks/src/test/java/org/apache/geode/benchmark/tests/ReplicatedIndexedAggregateQueryMinBenchmarkTest.java new file mode 100644 index 000000000..6202d5735 --- /dev/null +++ b/geode-benchmarks/src/test/java/org/apache/geode/benchmark/tests/ReplicatedIndexedAggregateQueryMinBenchmarkTest.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.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.benchmark.LongRange; +import org.apache.geode.perftest.TestRunners; + +@ExtendWith(TempDirectory.class) +public class ReplicatedIndexedAggregateQueryMinBenchmarkTest { + private File folder; + + @BeforeEach + void createTemporaryFolder(@TempDirectory.TempDir Path tempFolder) { + folder = tempFolder.toFile(); + } + + @Test + public void benchmarkRunsSuccessfully() throws Exception { + ReplicatedIndexedAggregateQueryMinBenchmark test = + new ReplicatedIndexedAggregateQueryMinBenchmark(); + test.setKeyRange(new LongRange(0, 100)); + test.setQueryRange(10); + TestRunners.minimalRunner(folder).runTest(test); + } + +} diff --git a/geode-benchmarks/src/test/java/org/apache/geode/benchmark/tests/ReplicatedIndexedAggregateQuerySumBenchmarkTest.java b/geode-benchmarks/src/test/java/org/apache/geode/benchmark/tests/ReplicatedIndexedAggregateQuerySumBenchmarkTest.java new file mode 100644 index 000000000..5f5569bf6 --- /dev/null +++ b/geode-benchmarks/src/test/java/org/apache/geode/benchmark/tests/ReplicatedIndexedAggregateQuerySumBenchmarkTest.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.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.benchmark.LongRange; +import org.apache.geode.perftest.TestRunners; + +@ExtendWith(TempDirectory.class) +public class ReplicatedIndexedAggregateQuerySumBenchmarkTest { + private File folder; + + @BeforeEach + void createTemporaryFolder(@TempDirectory.TempDir Path tempFolder) { + folder = tempFolder.toFile(); + } + + @Test + public void benchmarkRunsSuccessfully() throws Exception { + ReplicatedIndexedAggregateQuerySumBenchmark test = + new ReplicatedIndexedAggregateQuerySumBenchmark(); + test.setKeyRange(new LongRange(0, 100)); + test.setQueryRange(10); + TestRunners.minimalRunner(folder).runTest(test); + } + +} diff --git a/geode-benchmarks/src/test/java/org/apache/geode/benchmark/tests/ReplicatedIndexedAggregateQuerySumDistinctBenchmarkTest.java b/geode-benchmarks/src/test/java/org/apache/geode/benchmark/tests/ReplicatedIndexedAggregateQuerySumDistinctBenchmarkTest.java new file mode 100644 index 000000000..5e1c41cce --- /dev/null +++ b/geode-benchmarks/src/test/java/org/apache/geode/benchmark/tests/ReplicatedIndexedAggregateQuerySumDistinctBenchmarkTest.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.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.benchmark.LongRange; +import org.apache.geode.perftest.TestRunners; + +@ExtendWith(TempDirectory.class) +public class ReplicatedIndexedAggregateQuerySumDistinctBenchmarkTest { + private File folder; + + @BeforeEach + void createTemporaryFolder(@TempDirectory.TempDir Path tempFolder) { + folder = tempFolder.toFile(); + } + + @Test + public void benchmarkRunsSuccessfully() throws Exception { + ReplicatedIndexedAggregateQuerySumDistinctBenchmark test = + new ReplicatedIndexedAggregateQuerySumDistinctBenchmark(); + test.setKeyRange(new LongRange(0, 100)); + test.setQueryRange(10); + TestRunners.minimalRunner(folder).runTest(test); + } + +}