Commit Graph

19 Commits

Author SHA1 Message Date
William Banfield
2b7f46206e change output and related tests 2022-05-11 13:37:02 -04:00
William Banfield
ad577e93d4 sort data and merge 2022-05-11 13:27:50 -04:00
William Banfield
5b5dc2ea95 use strings.Builder 2022-05-11 10:12:54 -04:00
William Banfield
81cac78702 field renames 2022-05-11 10:10:23 -04:00
William Banfield
4eb6bdaee7 use fmt.Print 2022-05-11 10:04:29 -04:00
William Banfield
0048bfe5a9 use flag.Arg 2022-05-11 10:03:05 -04:00
William Banfield
8ebbc52b97 close files 2022-05-11 10:00:47 -04:00
William Banfield
ace89bf523 simplify open error 2022-05-11 09:59:51 -04:00
William Banfield
4257b0762e non allocating decl 2022-05-11 09:58:19 -04:00
William Banfield
e0badc0b2f rename diff function 2022-05-11 09:57:26 -04:00
William Banfield
7947e9ea5f change struct name 2022-05-11 09:56:28 -04:00
William Banfield
f3550cea47 use want as name in test 2022-05-11 09:54:50 -04:00
William Banfield
dc1d9d48e0 use NArg 2022-05-11 09:52:49 -04:00
William Banfield
f834edea56 Update scripts/metricsgen/metricsdiff/metricsdiff.go
Co-authored-by: M. J. Fromberger <fromberger@interchain.io>
2022-05-11 09:50:53 -04:00
William Banfield
8c5f42949f Update scripts/metricsgen/metricsdiff/metricsdiff.go
Co-authored-by: M. J. Fromberger <fromberger@interchain.io>
2022-05-11 09:49:15 -04:00
William Banfield
035356df64 Update scripts/metricsgen/metricsdiff/metricsdiff.go
Co-authored-by: M. J. Fromberger <fromberger@interchain.io>
2022-05-11 09:48:19 -04:00
William Banfield
672a26a3cf Update scripts/metricsgen/metricsdiff/metricsdiff.go
Co-authored-by: M. J. Fromberger <fromberger@interchain.io>
2022-05-11 09:47:51 -04:00
William Banfield
118b48fba0 scripts/metricsgen: add metricsdiff tool 2022-05-11 00:06:04 -04:00
William Banfield
4b36feaa2b scripts/metricsgen: add the initial version of metricsgen (#8479)
This pull requests adds a new tool, metricsgen, for generating Tendermint metrics constructors from `Metrics` struct definitions. This tool aims to reduce the amount of boilerplate required to add additional metrics to Tendermint.

Its working is fairly simple, it parses the go ast, extracts field information, and uses this field information to execute a go template. 

This pull request also adds a proof-of-concept of the tool's output and working by using it to generate the [indexer metrics](https://github.com/tendermint/tendermint/pull/8479/files#diff-4b0c597b6fa05332a2f9a8e0ce079e360602942fae99dc5485f1edfe71c0a29e) using `//go:generate` directives and a simple `make` target.

The next steps for this tool are documented in https://github.com/tendermint/tendermint/issues/8485 and https://github.com/tendermint/tendermint/issues/8486, which detail using the tool to generate the `metrics.md` documentation file and using the tool to migrate away from `go-kit`.
2022-05-09 22:52:10 +00:00