The core protocol of WoopChain
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
woop/core/blockchain_pruner_metric.go

73 lines
1.7 KiB

package core
import (
prom "github.com/woop-chain/woop/api/service/prometheus"
"github.com/prometheus/client_golang/prometheus"
)
func init() {
prom.PromRegistry().MustRegister(
deletedValidatorSnapshot,
skipValidatorSnapshot,
deletedBlockCount,
prunerMaxBlock,
deletedBlockCountUsedTime,
compactBlockCountUsedTime,
)
}
var (
deletedValidatorSnapshot = prometheus.NewCounter(
prometheus.CounterOpts{
Namespace: "wiki",
Subsystem: "blockchain_pruner",
Name: "deleted_validator_snapshot",
Help: "number of deleted validator snapshot count",
},
)
skipValidatorSnapshot = prometheus.NewCounter(
prometheus.CounterOpts{
Namespace: "wiki",
Subsystem: "stream",
Name: "skip_validator_snapshot",
Help: "number of skip validator snapshot count",
},
)
deletedBlockCount = prometheus.NewCounter(
prometheus.CounterOpts{
Namespace: "wiki",
Subsystem: "blockchain_pruner",
Name: "deleted_block_count",
Help: "number of deleted block count",
},
)
prunerMaxBlock = prometheus.NewGauge(
prometheus.GaugeOpts{
Namespace: "wiki",
Subsystem: "stream",
Name: "pruner_max_block",
Help: "number of largest pruner block",
},
)
deletedBlockCountUsedTime = prometheus.NewCounter(
prometheus.CounterOpts{
Namespace: "wiki",
Subsystem: "blockchain_pruner",
Name: "deleted_block_count_used_time",
Help: "sum of deleted block used time in ms",
},
)
compactBlockCountUsedTime = prometheus.NewCounter(
prometheus.CounterOpts{
Namespace: "wiki",
Subsystem: "blockchain_pruner",
Name: "compact_block_count_used_time",
Help: "sum of compact block time in ms",
},
)
)