metricsgen: port metrics code generation tool (#9156)

This is a port of #8470 and #8501 from the former mainline branch, in
support of #2600 and #9076. 

No additional changes other than checking out the code have been
implemented in this PR. A subsequent PR will incorporate this code.
This commit is contained in:
Sam Kleinman
2022-08-03 14:02:18 +00:00
committed by GitHub
parent ea271c534a
commit 4f30c90e62
10 changed files with 1014 additions and 0 deletions
+11
View File
@@ -0,0 +1,11 @@
package basic
import "github.com/go-kit/kit/metrics"
//go:generate go run ../../../../scripts/metricsgen -struct=Metrics
// Metrics contains metrics exposed by this package.
type Metrics struct {
// simple metric that tracks the height of the chain.
Height metrics.Gauge
}