go-ethereum/consensus/hybrid-consensus/metrics.go
oxwa 5b14eb3f28 Changes to be committed:
new file:   cmd/geth/consensus/hybrid.go
	new file:   cmd/geth/core/blockchain.go
	modified:   cmd/geth/main.go
	new file:   cmd/geth/tests/hybrid_test.go
	new file:   consensus/hybrid-consensus/consensus.go
	new file:   consensus/hybrid-consensus/consensus_test.go
	new file:   consensus/hybrid-consensus/go.mod
	new file:   consensus/hybrid-consensus/hybridconsensus.go
	new file:   consensus/hybrid-consensus/metrics.go
	new file:   consensus/hybrid-consensus/validators.go
2024-10-06 16:33:49 +03:00

16 lines
293 B
Go

package hybridconsensus
import (
"time"
)
type Metrics struct {
BlockCreationTime time.Duration
TotalBlocks uint64
}
func (hc *HybridConsensus) RecordBlockCreationTime(start time.Time) {
hc.metrics.BlockCreationTime = time.Since(start)
hc.metrics.TotalBlocks++
}