-
Notifications
You must be signed in to change notification settings - Fork 1
feat(orchestrator): add AWS S3 seed objects to LocalStack init #47
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
Open
erenaslandev
wants to merge
7
commits into
main
Choose a base branch
from
DT-838
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
010edd6
feat(orchestrator): add AWS S3 seed objects to LocalStack init
erenaslandev 51126d6
refactor(runner): make generic mid delivery action method
erenaslandev 00d90b5
fix(runner): add missing container cleanup, correct function comment and
erenaslandev fc4fbb4
feat(runner): aggregate resource metrics for crash/restart
erenaslandev 5210813
fix(results): skip only truly idle containers in aggregation, not
erenaslandev ff5c920
fix: support multi-container metric collection
erenaslandev fb36f09
fix(collector): floor CPU idle at 0 when summed usage exceeds 100%
erenaslandev 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 |
|---|---|---|
| @@ -0,0 +1,85 @@ | ||
| package main | ||
|
|
||
| import ( | ||
| "bufio" | ||
| "io" | ||
| "strings" | ||
| "testing" | ||
| "time" | ||
| ) | ||
|
|
||
| // chunkedReader yields one fixed chunk per Read call with a small delay | ||
| // between chunks, so consecutive reads land on distinct timestamps. | ||
| type chunkedReader struct { | ||
| chunks []string | ||
| delay time.Duration | ||
| } | ||
|
|
||
| func (c *chunkedReader) Read(p []byte) (int, error) { | ||
| if len(c.chunks) == 0 { | ||
| return 0, io.EOF | ||
| } | ||
| if c.delay > 0 { | ||
| time.Sleep(c.delay) | ||
| } | ||
| n := copy(p, c.chunks[0]) | ||
| if n == len(c.chunks[0]) { | ||
| c.chunks = c.chunks[1:] | ||
| } else { | ||
| c.chunks[0] = c.chunks[0][n:] | ||
| } | ||
| return n, nil | ||
| } | ||
|
|
||
| func TestStampingReader(t *testing.T) { | ||
| // A burst far below recordLine's 1024-line sampling threshold must still | ||
| // produce a non-empty receive window (lastNs > firstNs) when the data | ||
| // arrives across multiple reads — the regression behind EPS 0 on | ||
| // 1,000-line crash/restart cases. | ||
| shard := &connStats{} | ||
| src := &chunkedReader{ | ||
| chunks: []string{"a\nb\n", "c\nd\n"}, | ||
| delay: 5 * time.Millisecond, | ||
| } | ||
| scanner := bufio.NewScanner(&stampingReader{r: src, shard: shard}) | ||
| lines := 0 | ||
| for scanner.Scan() { | ||
| shard.recordLine(int64(len(scanner.Bytes())) + 1) | ||
| lines++ | ||
| } | ||
| if err := scanner.Err(); err != nil { | ||
| t.Fatalf("scan: %v", err) | ||
| } | ||
| if lines != 4 { | ||
| t.Fatalf("lines = %d, want 4", lines) | ||
| } | ||
| first, last := shard.firstNs.Load(), shard.lastNs.Load() | ||
| if first == 0 { | ||
| t.Fatal("firstNs not stamped") | ||
| } | ||
| if last <= first { | ||
| t.Fatalf("lastNs (%d) <= firstNs (%d): receive window empty", last, first) | ||
| } | ||
| } | ||
|
|
||
| func TestStampingReaderFirstNsStable(t *testing.T) { | ||
| // firstNs is stamped once on the first read and never moves. | ||
| shard := &connStats{} | ||
| sr := &stampingReader{r: strings.NewReader("x\n"), shard: shard} | ||
| buf := make([]byte, 16) | ||
| if _, err := sr.Read(buf); err != nil { | ||
| t.Fatalf("read: %v", err) | ||
| } | ||
| first := shard.firstNs.Load() | ||
| time.Sleep(2 * time.Millisecond) | ||
| sr.r = strings.NewReader("y\n") | ||
| if _, err := sr.Read(buf); err != nil { | ||
| t.Fatalf("read: %v", err) | ||
| } | ||
| if got := shard.firstNs.Load(); got != first { | ||
| t.Fatalf("firstNs moved: %d → %d", first, got) | ||
| } | ||
| if shard.lastNs.Load() <= first { | ||
| t.Fatal("lastNs not refreshed on second read") | ||
| } | ||
| } |
This file contains hidden or 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 hidden or 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
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.