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

Synchronize common files from prometheus/prometheus #83

Merged
merged 2 commits into from
Oct 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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)
6 changes: 6 additions & 0 deletions Makefile.common
Original file line number Diff line number Diff line change
Expand Up @@ -275,3 +275,9 @@ $(1)_precheck:
exit 1; \
fi
endef

govulncheck: install-govulncheck
govulncheck ./...

install-govulncheck:
command -v govulncheck > /dev/null || go install golang.org/x/vuln/cmd/govulncheck@latest
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
Loading