Some checks are pending
docker-build-cometbft / vars (push) Waiting to run
docker-build-cometbft / build-images (amd64, ubuntu-24.04) (push) Blocked by required conditions
docker-build-cometbft / build-images (arm64, ubuntu-24.04-arm) (push) Blocked by required conditions
docker-build-cometbft / merge-images (push) Blocked by required conditions
docker-build-e2e-node / vars (push) Waiting to run
docker-build-e2e-node / build-images (amd64, ubuntu-24.04) (push) Blocked by required conditions
docker-build-e2e-node / build-images (arm64, ubuntu-24.04-arm) (push) Blocked by required conditions
docker-build-e2e-node / merge-images (push) Blocked by required conditions
58 lines
1.9 KiB
Go
58 lines
1.9 KiB
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...),
|
|
NumTxs: prometheus.NewGaugeFrom(stdprometheus.GaugeOpts{
|
|
Namespace: namespace,
|
|
Subsystem: MetricsSubsystem,
|
|
Name: "num_txs",
|
|
Help: "Number of transactions in the latest block.",
|
|
}, labels).With(labelsAndValues...),
|
|
TotalTxs: prometheus.NewGaugeFrom(stdprometheus.GaugeOpts{
|
|
Namespace: namespace,
|
|
Subsystem: MetricsSubsystem,
|
|
Name: "total_txs",
|
|
Help: "Total number of transactions.",
|
|
}, labels).With(labelsAndValues...),
|
|
BlockSizeBytes: prometheus.NewGaugeFrom(stdprometheus.GaugeOpts{
|
|
Namespace: namespace,
|
|
Subsystem: MetricsSubsystem,
|
|
Name: "block_size_bytes",
|
|
Help: "Size of the latest block.",
|
|
}, labels).With(labelsAndValues...),
|
|
LatestBlockHeight: prometheus.NewGaugeFrom(stdprometheus.GaugeOpts{
|
|
Namespace: namespace,
|
|
Subsystem: MetricsSubsystem,
|
|
Name: "latest_block_height",
|
|
Help: "The height of the latest block.",
|
|
}, labels).With(labelsAndValues...),
|
|
}
|
|
}
|
|
|
|
func NopMetrics() *Metrics {
|
|
return &Metrics{
|
|
Syncing: discard.NewGauge(),
|
|
NumTxs: discard.NewGauge(),
|
|
TotalTxs: discard.NewGauge(),
|
|
BlockSizeBytes: discard.NewGauge(),
|
|
LatestBlockHeight: discard.NewGauge(),
|
|
}
|
|
}
|