From 2e28427dab723cdd9e41df33dab540fac9d8842a Mon Sep 17 00:00:00 2001 From: Sam Kleinman Date: Tue, 9 Aug 2022 17:00:55 -0400 Subject: [PATCH] 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. --- Makefile | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/Makefile b/Makefile index 75887c6b0..ab81a6e66 100644 --- a/Makefile +++ b/Makefile @@ -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 ###