liran-funaro commented on a change in pull request #10593:
URL: https://github.com/apache/druid/pull/10593#discussion_r533126179
##########
File path:
benchmarks/src/test/java/org/apache/druid/benchmark/FilteredAggregatorBenchmark.java
##########
@@ -205,30 +184,106 @@ public void setup() throws IOException
GeneratorSchemaInfo basicSchema =
GeneratorBasicSchemas.SCHEMA_MAP.get("basic");
QuerySegmentSpec intervalSpec = new
MultipleIntervalSegmentSpec(Collections.singletonList(basicSchema.getDataInterval()));
- List<AggregatorFactory> queryAggs = new ArrayList<>();
- queryAggs.add(filteredMetrics[0]);
+ List<AggregatorFactory> queryAggs =
Collections.singletonList(filteredMetric);
query = Druids.newTimeseriesQueryBuilder()
.dataSource("blah")
.granularity(Granularities.ALL)
.intervals(intervalSpec)
.aggregators(queryAggs)
- .descending(false)
+ .descending(descending)
.build();
}
- @TearDown
- public void tearDown() throws IOException
+ @State(Scope.Benchmark)
+ public static class IncrementalIndexState
+ {
+ @Param({"onheap", "offheap"})
+ private String indexType;
+
+ IncrementalIndex<?> incIndex;
+
+ @Setup
+ public void setup(FilteredAggregatorBenchmark global) throws
JsonProcessingException
+ {
+ global.appendableIndexSpec =
IncrementalIndexCreator.parseIndexType(indexType);
+ incIndex = global.makeIncIndex(global.schemaInfo.getAggsArray());
+ global.generator.addToIndex(incIndex, global.rowsPerSegment);
+ }
+
+ @TearDown
+ public void tearDown()
+ {
+ incIndex.close();
+ }
+ }
+
+ @State(Scope.Benchmark)
+ public static class IncrementalIndexIngestState
{
- FileUtils.deleteDirectory(tmpDir);
Review comment:
Note that it was not deleted. It just moved below to the teardown of the
`QueryableIndexState`: `qIndexesDir.delete();`
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]