This repository was archived by the owner on Aug 23, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 107
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
this replaces the enricher implementation to improve its enrichment performance. it drops the enrichment cache and it also doesn't filter metrics based on the meta records at the enrichment stage anymore. instead it is now building a map from which it can lookup the metric keys and resolve them into meta records, from which it then gets the meta tags. especially in scenarios where there is a large number of meta records in the index this performs much better than the old implementation.
this has the purpose of improving the addMetric performance when a large number of metrics gets added to the index concurrently. previously each of them would have been checked against the filter requirements of each existing meta record, due to how we now process them in batches this process is more efficient. instead of checking each new metric one by one against each meta record criteria, we're now building a small temporary index out of all the added metrics in the buffer, then we run each meta record as a query on that small index. this change improves the addMetric event processing performance by a huge factor in situations where a lot of metrics get added at once.
FYI I'm planning to create a follow-up PR which will not change any logic. It will only move code around and rename stuff to create a separate package for all tag and meta tag related stuff and make names more explanatory. This is mostly just going to be house keeping to avoid namespace pollution of the memory index package. I'll probably also reorganize some of the tests and benchmarks into separate files to make their distribution more logical. |
robert-milan
approved these changes
Nov 15, 2019
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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 replaces the enricher implementation to make enrichment faster. There are mainly two important changes:
I will create a diagram to illustrate how it all works and post it here.