diff --git a/benchmarks/src/test/java/org/apache/druid/benchmark/query/GroupByBenchmark.java b/benchmarks/src/test/java/org/apache/druid/benchmark/query/GroupByBenchmark.java index 346b8e4a7f7b..9fb4343af3a1 100644 --- a/benchmarks/src/test/java/org/apache/druid/benchmark/query/GroupByBenchmark.java +++ b/benchmarks/src/test/java/org/apache/druid/benchmark/query/GroupByBenchmark.java @@ -121,12 +121,12 @@ import java.util.concurrent.TimeUnit; @State(Scope.Benchmark) -@Fork(value = 2) -@Warmup(iterations = 10) -@Measurement(iterations = 25) +@Fork(value = 1) +@Warmup(iterations = 5) +@Measurement(iterations = 15) public class GroupByBenchmark { - @Param({"2", "4"}) + @Param({"4"}) private int numProcessingThreads; @Param({"-1"}) @@ -141,7 +141,7 @@ public class GroupByBenchmark @Param({"all", "day"}) private String queryGranularity; - @Param({"force", "false"}) + @Param({"false", "true"}) private String vectorize; private static final Logger log = new Logger(GroupByBenchmark.class); @@ -514,7 +514,7 @@ public String getFormatString() @State(Scope.Benchmark) public static class IncrementalIndexState { - @Param({"onheap", "offheap"}) + @Param({"onheap"}) private String indexType; IncrementalIndex incIndex; diff --git a/benchmarks/src/test/java/org/apache/druid/benchmark/query/TimeseriesBenchmark.java b/benchmarks/src/test/java/org/apache/druid/benchmark/query/TimeseriesBenchmark.java index 97d20ca68ae8..5ea82211091f 100644 --- a/benchmarks/src/test/java/org/apache/druid/benchmark/query/TimeseriesBenchmark.java +++ b/benchmarks/src/test/java/org/apache/druid/benchmark/query/TimeseriesBenchmark.java @@ -26,7 +26,7 @@ import org.apache.druid.java.util.common.FileUtils; import org.apache.druid.java.util.common.Intervals; import org.apache.druid.java.util.common.concurrent.Execs; -import org.apache.druid.java.util.common.granularity.Granularities; +import org.apache.druid.java.util.common.granularity.Granularity; import org.apache.druid.java.util.common.guava.Sequence; import org.apache.druid.java.util.common.logger.Logger; import org.apache.druid.query.Druids; @@ -101,8 +101,8 @@ @State(Scope.Benchmark) @Fork(value = 1) -@Warmup(iterations = 10) -@Measurement(iterations = 25) +@Warmup(iterations = 5) +@Measurement(iterations = 15) public class TimeseriesBenchmark { @Param({"750000"}) @@ -114,6 +114,9 @@ public class TimeseriesBenchmark @Param({"true", "false"}) private boolean descending; + @Param({"all", "hour"}) + private String queryGranularity; + private static final Logger log = new Logger(TimeseriesBenchmark.class); private static final int RNG_SEED = 9999; private static final IndexMergerV9 INDEX_MERGER_V9; @@ -162,7 +165,7 @@ private void setupQueries() TimeseriesQuery queryA = Druids.newTimeseriesQueryBuilder() .dataSource("blah") - .granularity(Granularities.ALL) + .granularity(Granularity.fromString(queryGranularity)) .intervals(intervalSpec) .aggregators(queryAggs) .descending(descending) @@ -182,7 +185,7 @@ private void setupQueries() TimeseriesQuery timeFilterQuery = Druids.newTimeseriesQueryBuilder() .dataSource("blah") - .granularity(Granularities.ALL) + .granularity(Granularity.fromString(queryGranularity)) .intervals(intervalSpec) .aggregators(queryAggs) .descending(descending) @@ -202,7 +205,7 @@ private void setupQueries() TimeseriesQuery timeFilterQuery = Druids.newTimeseriesQueryBuilder() .dataSource("blah") - .granularity(Granularities.ALL) + .granularity(Granularity.fromString(queryGranularity)) .intervals(intervalSpec) .aggregators(queryAggs) .descending(descending) @@ -219,7 +222,7 @@ private void setupQueries() TimeseriesQuery timeFilterQuery = Druids.newTimeseriesQueryBuilder() .dataSource("blah") - .granularity(Granularities.ALL) + .granularity(Granularity.fromString(queryGranularity)) .intervals(intervalSpec) .aggregators(queryAggs) .descending(descending) @@ -271,7 +274,7 @@ public void setup() @State(Scope.Benchmark) public static class IncrementalIndexState { - @Param({"onheap", "offheap"}) + @Param({"onheap"}) private String indexType; IncrementalIndex incIndex; diff --git a/benchmarks/src/test/java/org/apache/druid/benchmark/query/TopNBenchmark.java b/benchmarks/src/test/java/org/apache/druid/benchmark/query/TopNBenchmark.java index e69bd15a5f0c..655b0d2a423f 100644 --- a/benchmarks/src/test/java/org/apache/druid/benchmark/query/TopNBenchmark.java +++ b/benchmarks/src/test/java/org/apache/druid/benchmark/query/TopNBenchmark.java @@ -26,7 +26,7 @@ import org.apache.druid.jackson.DefaultObjectMapper; import org.apache.druid.java.util.common.FileUtils; import org.apache.druid.java.util.common.concurrent.Execs; -import org.apache.druid.java.util.common.granularity.Granularities; +import org.apache.druid.java.util.common.granularity.Granularity; import org.apache.druid.java.util.common.guava.Sequence; import org.apache.druid.java.util.common.logger.Logger; import org.apache.druid.offheap.OffheapBufferGenerator; @@ -98,8 +98,8 @@ @State(Scope.Benchmark) @Fork(value = 1) -@Warmup(iterations = 10) -@Measurement(iterations = 25) +@Warmup(iterations = 5) +@Measurement(iterations = 15) public class TopNBenchmark { @Param({"750000"}) @@ -111,6 +111,9 @@ public class TopNBenchmark @Param({"10"}) private int threshold; + @Param({"all", "hour"}) + private String queryGranularity; + private static final Logger log = new Logger(TopNBenchmark.class); private static final int RNG_SEED = 9999; private static final IndexMergerV9 INDEX_MERGER_V9; @@ -159,7 +162,7 @@ private void setupQueries() TopNQueryBuilder queryBuilderA = new TopNQueryBuilder() .dataSource("blah") - .granularity(Granularities.ALL) + .granularity(Granularity.fromString(queryGranularity)) .dimension("dimSequential") .metric("sumFloatNormal") .intervals(intervalSpec) @@ -175,7 +178,7 @@ private void setupQueries() TopNQueryBuilder queryBuilderA = new TopNQueryBuilder() .dataSource("blah") - .granularity(Granularities.ALL) + .granularity(Granularity.fromString(queryGranularity)) .dimension("dimUniform") .metric(new DimensionTopNMetricSpec(null, StringComparators.NUMERIC)) .intervals(intervalSpec) @@ -191,7 +194,7 @@ private void setupQueries() TopNQueryBuilder queryBuilderA = new TopNQueryBuilder() .dataSource("blah") - .granularity(Granularities.ALL) + .granularity(Granularity.fromString(queryGranularity)) .dimension("dimUniform") .metric(new DimensionTopNMetricSpec(null, StringComparators.ALPHANUMERIC)) .intervals(intervalSpec) @@ -249,7 +252,7 @@ public void setup() @State(Scope.Benchmark) public static class IncrementalIndexState { - @Param({"onheap", "offheap"}) + @Param({"onheap"}) private String indexType; IncrementalIndex incIndex;