-
Notifications
You must be signed in to change notification settings - Fork 454
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve performance of generatings IDs from tags in M3Coordinator #1000
Merged
Merged
Changes from 12 commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
e00630c
Improve performance of generating IDs from tags
01ef7ae
Fix
b77243c
update comments
2fde678
Fix error
a24b31e
Refactor IDLen function
fd32544
Fix stuff
8a85448
fix compulation isuse
f823c5d
Fix compilation issue
ff13c86
Add minimum go version
d528c01
Rename
317b87c
Rename value in test
753c68f
Improve test
a9919a6
Special case single datapoint write
3851b65
fix compilation issue;
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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 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 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 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -269,11 +269,15 @@ func (s *m3storage) Write( | |
return errors.ErrNilWriteQuery | ||
} | ||
|
||
id := query.Tags.ID() | ||
// TODO: Consider caching id -> identID | ||
identID := ident.StringID(id) | ||
var ( | ||
// TODO: Pool this once an ident pool is setup. We will have | ||
// to stop calling NoFinalize() below if we do that. | ||
buf = make([]byte, 0, query.Tags.IDLen()) | ||
idBuf = query.Tags.IDMarshalTo(buf) | ||
id = ident.BytesID(idBuf) | ||
) | ||
// Set id to NoFinalize to avoid cloning it in write operations | ||
identID.NoFinalize() | ||
id.NoFinalize() | ||
tagIterator := storage.TagsToIdentTagIterator(query.Tags) | ||
|
||
var ( | ||
|
@@ -287,7 +291,7 @@ func (s *m3storage) Write( | |
datapoint := datapoint | ||
wg.Add(1) | ||
s.writeWorkerPool.Go(func() { | ||
if err := s.writeSingle(ctx, query, datapoint, identID, tagIter); err != nil { | ||
if err := s.writeSingle(ctx, query, datapoint, id, tagIter); err != nil { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could we add a special case here for when There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. done |
||
multiErr.add(err) | ||
} | ||
|
||
|
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this 1.10+ only feature ? If yes, maybe we should figure out if we are still planning to support 1.9
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
1.9 is over a year old at this point, 1.10 is over 6 months old. 1.11 just came out.
Any reason you want to support 1.9?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably ok to drop support, since we're only supporting built binaries really. We would like most people to use all this software as docker images or as binaries built from the tagged releases.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nah, i agree that we should drop 1.9 support. Even prom only supports 1.10+ prometheus/prometheus#3856. We should call it out in our README though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah yup, @richardartoul want to update the README.md (in a minimal way, we can update formatting/etc of it later) that we only support 1.10 at this time?