Enhance Profile API to Show Star Tree Pre-computation Times #19527
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This change enables star tree profiling and also profiles the
pre-computation phase
when profiling aggregations. Sometimes when getting building leaf collector, the precomputation phase is part of that, therefore, we want to separate the rest of the precomputation phase from the logic intryPrecomputeAggregationForLeaf
.A change I made was to update
ProfilingAggregator.java
so that now it can override the logic oftryPrecomputeAggregationForLeaf
to account for timing. Additionally, inAggregator.java
, I moved the method of precomputing from the base class toAggregator
so thatProfilingAggregator
could override that method.For collecting the profiling information for the star tree sub-phases, I noticed that all aggregators that use star tree both scan the star tree index to find the matched star tree document ids and add those ids into the buckets. All star tree pre-computation supporting aggregators implement
StarTreePreComputeCollector
, therefore, I added the methods into that class so that the aggregators could implement them. The reason for this is to separate the logic for scanning the star tree and filling those buckets.Finally, for collecting the breakdown results, I create a new breakdown
StarTreeProfileBreakdown.java
which represents a breakdown for the star tree phase. In AggregationProfileBreakdown.java, I added a few methods to detect whether aStarTreeProfileBreakdown
has been attached and to also keep track of the breakdown. EachAggregationProfileBreakdown
could have at most oneStarTreeProfileBreakdown
attached to it. Additionally, inInternalAggregationProfileTree.java
, I added some logic to add the star tree profiling result as a child to thatAggregationProfileBreakdown
.Related Issues
Resolves #19295
Check List
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.