-
Notifications
You must be signed in to change notification settings - Fork 18
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
add support to batch metric and send on a strict interval #169
Closed
Closed
Changes from 7 commits
Commits
Show all changes
35 commits
Select commit
Hold shift + click to select a range
d0c14db
prototype a more definite flush interval control restricting when any…
maciuszek cefa4c8
fix settings
maciuszek 2f51fd7
add todo to review buffering capacity
maciuszek 384f462
improve naming
maciuszek 90a0f82
fix outc processing competition and allow batching
maciuszek 391d649
fix pre-exisiting volatile test
maciuszek 257ebc4
optimize delays for concurrent action in tests
maciuszek 0d06f21
major fix: previously the batching would have blocked once the buffer…
maciuszek dba2df8
fix comment
maciuszek 3d32fa5
fix spelling for linter
maciuszek 101187d
a bit of a redesign with improvements to code breakdown
maciuszek 5a6293c
fix comments
maciuszek 446188d
readd doflush outc drain logic
maciuszek c3b9a08
improve comments
maciuszek b3722fa
refactor to support retries in batch send
maciuszek 1c80dae
fix lint
maciuszek d1944c2
add ugly code to cover batching in all scenarios cases and consider e…
maciuszek b7f0a3d
fix spelling for linter
maciuszek b1ed20e
guarentee batch doesn't starve
maciuszek eeb03f2
expand some comments and add todo
maciuszek 40cac66
improve batch send timeout
maciuszek 3837a52
add tests for batch autosend
maciuszek 10b9773
clean up comments
maciuszek 5828040
fix spelling for linter
maciuszek a46cf32
fix batch send failure remining batch logic
maciuszek 51ee282
fix lint errors
maciuszek d3e4b19
improve batch send tests
maciuszek 747fbc2
made batch configuration more granular
maciuszek 9c6f78f
fix spelling
maciuszek 25cd271
improve comments
maciuszek a8ec4d4
improve variable naming
maciuszek abc1e18
restructure
maciuszek 108884c
refactor how we send metrics with an interface design optimizing loop…
maciuszek 1a0e7d4
fix spelling for linter
maciuszek 9b67c65
only create connection when we need to for batch sends
maciuszek 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
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 |
---|---|---|
|
@@ -78,9 +78,9 @@ func TestValidateTags(t *testing.T) { | |
store.Flush() | ||
|
||
expected := "test:1|c" | ||
counter := sink.record | ||
if !strings.Contains(counter, expected) { | ||
t.Error("wanted counter value of test:1|c, got", counter) | ||
output := sink.record | ||
if !strings.Contains(output, expected) && !strings.Contains(output, "reserved_tag") { | ||
t.Errorf("Expected without reserved tags: '%s' Got: '%s'", expected, output) | ||
} | ||
|
||
// A reserved tag should trigger adding the reserved_tag counter | ||
|
@@ -89,10 +89,11 @@ func TestValidateTags(t *testing.T) { | |
store.NewCounterWithTags("test", map[string]string{"host": "i"}).Inc() | ||
store.Flush() | ||
|
||
expected = "reserved_tag:1|c\ntest.__host=i:1|c" | ||
counter = sink.record | ||
if !strings.Contains(counter, expected) { | ||
t.Error("wanted counter value of test.___f=i:1|c, got", counter) | ||
expected = "test.__host=i:1|c" | ||
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. Note: this test is out of scope of this work but it was previously volatile with the order of reserved_tag vs test.__host not being deterministic |
||
expectedReservedTag := "reserved_tag:1|c" | ||
output = sink.record | ||
if !strings.Contains(output, expected) && !strings.Contains(output, expectedReservedTag) { | ||
t.Errorf("Expected: '%s' and '%s', In: '%s'", expected, expectedReservedTag, output) | ||
} | ||
} | ||
|
||
|
Oops, something went wrong.
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.
To make threading possible forking #169 (review) to here . @sokada1221.So this doesn't restrict memory allocated, but the amount of slots per metric/string.If it exceeds it'll block more stats for being written until read, it wouldn't act as a batching mechanism 🤔. buffered channeled are a bit strange, i think in actuality this buffer will always be full, if we would change it to normal channel with no buffer (always block), i don't think we would see an impact.