neoneo-go/pkg/core/mempool/prometheus.go

25 lines
460 B
Go
Raw Normal View History

2020-01-15 07:52:59 +00:00
package mempool
import "github.com/prometheus/client_golang/prometheus"
var (
//mempoolUnsortedTx prometheus metric.
mempoolUnsortedTx = prometheus.NewGauge(
prometheus.GaugeOpts{
Help: "Mempool Unsorted TXs",
Name: "mempool_unsorted_tx",
Namespace: "neogo",
},
)
)
func init() {
prometheus.MustRegister(
mempoolUnsortedTx,
)
}
func updateMempoolMetrics(unsortedTxnLen int) {
2020-01-15 07:52:59 +00:00
mempoolUnsortedTx.Set(float64(unsortedTxnLen))
}