Skip to content
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

feat(memlimit): support dynamic memory limit #23

Merged
merged 2 commits into from
Dec 1, 2024
Merged

Conversation

KimMachineGun
Copy link
Owner

@KimMachineGun KimMachineGun commented Nov 10, 2024

#15

Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot reviewed 6 out of 8 changed files in this pull request and generated 2 suggestions.

Files not reviewed (2)
  • examples/dynamic/go.mod: Language not supported
  • examples/dynamic/limit.txt: Language not supported
Comments skipped due to low confidence (5)

examples/dynamic/main.go:16

  • [nitpick] Setting the default logger globally might affect other parts of the application. Consider passing the logger explicitly where needed.
slog.SetDefault(slog.New(slog.NewJSONHandler(os.Stderr, nil)))

memlimit/memlimit_common_test.go:1

  • Add a test case for the scenario where the memory limit is not set (i.e., ErrNoLimit).
func TestSetGoMemLimitWithProvider(t *testing.T) {

memlimit/memlimit.go:164

  • The error message 'cannot parse AUTOMEMLIMIT: %s' could be improved for clarity. It should specify that the value is invalid. Suggested change: 'invalid AUTOMEMLIMIT value: %s'.
return 0, fmt.Errorf("cannot parse AUTOMEMLIMIT: %s", val)

memlimit/memlimit.go:205

  • [nitpick] The comment 'See more details in the documentation of WithRefreshInterval' is ambiguous. It should specify where the documentation is located.
// See more details in the documentation of WithRefreshInterval.

memlimit/memlimit.go:274

  • [nitpick] The function name 'maxInt64OnNoLimit' is unclear. It should be renamed to something more descriptive, such as 'setMaxInt64IfNoLimit'.
func maxInt64OnNoLimit(provider Provider) Provider {

examples/dynamic/main.go Show resolved Hide resolved
examples/dynamic/main.go Show resolved Hide resolved
@KimMachineGun KimMachineGun merged commit c505832 into main Dec 1, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant