metrics: add metricsgen makefile target (#9172)

Follow on work as a missing piece of #9156, to make it possible to
generate metrics automatically using existing build infrastructure.
This commit is contained in:
Sam Kleinman
2022-08-09 17:00:55 -04:00
committed by GitHub
parent f295b4d431
commit 152a2fa5c9

View File

@@ -131,6 +131,20 @@ install:
CGO_ENABLED=$(CGO_ENABLED) go install $(BUILD_FLAGS) -tags $(BUILD_TAGS) ./cmd/tendermint
.PHONY: install
###############################################################################
### Metrics ###
###############################################################################
metrics: testdata-metrics
go generate -run="scripts/metricsgen" ./...
.PHONY: metrics
# By convention, the go tool ignores subdirectories of directories named
# 'testdata'. This command invokes the generate command on the folder directly
# to avoid this.
testdata-metrics:
ls ./scripts/metricsgen/testdata | xargs -I{} go generate -v -run="scripts/metricsgen" ./scripts/metricsgen/testdata/{}
.PHONY: testdata-metrics
###############################################################################
### Mocks ###