mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-19 02:12:23 +00:00
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
16 lines
293 B
Go
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++
|
|
}
|
|
|