mirror of
https://github.com/tendermint/tendermint.git
synced 2026-02-03 10:32:05 +00:00
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.
31 lines
785 B
Go
31 lines
785 B
Go
// Code generated by metricsgen. DO NOT EDIT.
|
|
|
|
package basic
|
|
|
|
import (
|
|
"github.com/go-kit/kit/metrics/discard"
|
|
prometheus "github.com/go-kit/kit/metrics/prometheus"
|
|
stdprometheus "github.com/prometheus/client_golang/prometheus"
|
|
)
|
|
|
|
func PrometheusMetrics(namespace string, labelsAndValues ...string) *Metrics {
|
|
labels := []string{}
|
|
for i := 0; i < len(labelsAndValues); i += 2 {
|
|
labels = append(labels, labelsAndValues[i])
|
|
}
|
|
return &Metrics{
|
|
Height: prometheus.NewGaugeFrom(stdprometheus.GaugeOpts{
|
|
Namespace: namespace,
|
|
Subsystem: MetricsSubsystem,
|
|
Name: "height",
|
|
Help: "simple metric that tracks the height of the chain.",
|
|
}, labels).With(labelsAndValues...),
|
|
}
|
|
}
|
|
|
|
func NopMetrics() *Metrics {
|
|
return &Metrics{
|
|
Height: discard.NewGauge(),
|
|
}
|
|
}
|