This repository was archived by the owner on Aug 23, 2023. It is now read-only.
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.
This adds an optimization to make autocomplete requests faster.
It works like this:
For populating the auto complete value list we need to first execute the query specified, we then take the result set and enrich it with meta tags that match each of the metrics in the result set. From the set of the metric tags and enriched meta tags we then build the list of values to return to autocomplete requests.
The optimization which this PR implements is that in the case of autocomplete requests its not necessary to enrich every metric in the result set with all meta tags which match it, every meta tag only needs to enrich one metric in the result set and that will be sufficient for it to be taken into account when building the list of values to return. That way we can skip a lot of redundant enriching of metrics in the result set.
It also adds and refactors some unit tests.