Skip to content

Commit

Permalink
Move heap ballast util function to dskit
Browse files Browse the repository at this point in the history
So it can be shared by other programs.
  • Loading branch information
bboreham committed Dec 4, 2023
1 parent d110543 commit 6261144
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 34 deletions.
4 changes: 2 additions & 2 deletions cmd/mimir/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@ import (
"strings"

"github.com/go-kit/log/level"
"github.com/grafana/dskit/ballast"
"github.com/grafana/dskit/flagext"
"github.com/grafana/dskit/tracing"
"github.com/pkg/errors"
"github.com/prometheus/client_golang/prometheus"
"gopkg.in/yaml.v3"

"github.com/grafana/mimir/pkg/mimir"
"github.com/grafana/mimir/pkg/util"
util_log "github.com/grafana/mimir/pkg/util/log"
"github.com/grafana/mimir/pkg/util/usage"
"github.com/grafana/mimir/pkg/util/version"
Expand Down Expand Up @@ -179,7 +179,7 @@ func main() {
Registry: reg,
})

var ballast = util.AllocateBallast(mainFlags.ballastBytes)
var ballast = ballast.Allocate(mainFlags.ballastBytes)

// In testing mode skip JAEGER setup to avoid panic due to
// "duplicate metrics collector registration attempted"
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ require (
github.com/golang/snappy v0.0.4
github.com/google/gopacket v1.1.19
github.com/gorilla/mux v1.8.1
github.com/grafana/dskit v0.0.0-20231126215014-4cfd2dc0d14c
github.com/grafana/dskit v0.0.0-20231204113943-3040f31404f8
github.com/grafana/e2e v0.1.1
github.com/hashicorp/golang-lru v1.0.2 // indirect
github.com/json-iterator/go v1.1.12
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -541,8 +541,8 @@ github.com/gosimple/slug v1.1.1 h1:fRu/digW+NMwBIP+RmviTK97Ho/bEj/C9swrCspN3D4=
github.com/gosimple/slug v1.1.1/go.mod h1:ER78kgg1Mv0NQGlXiDe57DpCyfbNywXXZ9mIorhxAf0=
github.com/grafana-tools/sdk v0.0.0-20220919052116-6562121319fc h1:PXZQA2WCxe85Tnn+WEvr8fDpfwibmEPgfgFEaC87G24=
github.com/grafana-tools/sdk v0.0.0-20220919052116-6562121319fc/go.mod h1:AHHlOEv1+GGQ3ktHMlhuTUwo3zljV3QJbC0+8o2kn+4=
github.com/grafana/dskit v0.0.0-20231126215014-4cfd2dc0d14c h1:VzcctxlNlf/NmB/ZsX+dvcIZiEVm1xDZO+eCBhOSnSg=
github.com/grafana/dskit v0.0.0-20231126215014-4cfd2dc0d14c/go.mod h1:8dsy5tQOkeNQyjXpm5mQsbCu3H5uzeBD35MzRQFznKU=
github.com/grafana/dskit v0.0.0-20231204113943-3040f31404f8 h1:bRYRUeFr1UiJJsS2XFezQCr6i5DlCRwWaMPb272ZTqQ=
github.com/grafana/dskit v0.0.0-20231204113943-3040f31404f8/go.mod h1:8dsy5tQOkeNQyjXpm5mQsbCu3H5uzeBD35MzRQFznKU=
github.com/grafana/e2e v0.1.1 h1:/b6xcv5BtoBnx8cZnCiey9DbjEc8z7gXHO5edoeRYxc=
github.com/grafana/e2e v0.1.1/go.mod h1:RpNLgae5VT+BUHvPE+/zSypmOXKwEu4t+tnEMS1ATaE=
github.com/grafana/goautoneg v0.0.0-20231010094147-47ce5e72a9ae h1:Yxbw9jKGJVC6qAK5Ubzzb/qZwM6rRMMqaDc/d4Vp3pM=
Expand Down
24 changes: 0 additions & 24 deletions pkg/util/ballast_test.go

This file was deleted.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion vendor/modules.txt

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 6261144

Please sign in to comment.