mirror of
https://github.com/tendermint/tendermint.git
synced 2025-12-23 22:35:27 +00:00
31 lines
800 B
Go
31 lines
800 B
Go
// Code generated by metricsgen. DO NOT EDIT.
|
|
|
|
package blocksync
|
|
|
|
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{
|
|
Syncing: prometheus.NewGaugeFrom(stdprometheus.GaugeOpts{
|
|
Namespace: namespace,
|
|
Subsystem: MetricsSubsystem,
|
|
Name: "syncing",
|
|
Help: "Whether or not a node is block syncing. 1 if yes, 0 if no.",
|
|
}, labels).With(labelsAndValues...),
|
|
}
|
|
}
|
|
|
|
func NopMetrics() *Metrics {
|
|
return &Metrics{
|
|
Syncing: discard.NewGauge(),
|
|
}
|
|
}
|