Skip to content

Commit

Permalink
Added format command.
Browse files Browse the repository at this point in the history
Signed-off-by: bwplotka <[email protected]>
  • Loading branch information
bwplotka committed Oct 1, 2024
1 parent dbaddbd commit c13520f
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
19 changes: 18 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,21 @@ DOCKER_REPO ?= prometheuscommunity

include Makefile.common

DOCKER_IMAGE_NAME ?= avalanche
DOCKER_IMAGE_NAME ?= avalanche

GOIMPORTS = goimports
$(GOIMPORTS):
@go install golang.org/x/tools/cmd/goimports@latest

GOFUMPT = gofumpt
$(GOFUMPT):
@go install mvdan.cc/gofumpt@latest

GO_FILES = $(shell find . -path ./vendor -prune -o -name '*.go' -print)

.PHONY: format
format: $(GOFUMPT) $(GOIMPORTS)
@echo ">> formating imports)"
@$(GOIMPORTS) -local github.com/prometheus-community/avalanche -w $(GO_FILES)
@echo ">> gofumpt-ing the code; golangci-lint requires this"
@$(GOFUMPT) -extra -w $(GO_FILES)
1 change: 1 addition & 0 deletions metrics/write.go
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,7 @@ func collectMetrics(outOfOrder bool) ([]prompb.TimeSeries, error) {
}
return tss, nil
}

func shuffleTimestamps(tss []prompb.TimeSeries) []prompb.TimeSeries {
now := time.Now().UnixMilli()
offsets := []int64{0, -60 * 1000, -5 * 60 * 1000}
Expand Down

0 comments on commit c13520f

Please sign in to comment.