This commit is contained in:
Roy Crihfield 2020-11-19 23:46:21 +08:00
parent 4519052779
commit 0b70abc395
2 changed files with 5 additions and 5 deletions

View File

@ -2,9 +2,9 @@ package indexer
import ( import (
"database/sql" "database/sql"
"strings"
"github.com/ethereum/go-ethereum/metrics" "github.com/ethereum/go-ethereum/metrics"
"strings"
) )
const ( const (
@ -24,7 +24,7 @@ func metricName(subsystem, name string) string {
return strings.Join(parts, "/") return strings.Join(parts, "/")
} }
type indexerMetricsContext struct { type indexerMetricsHandles struct {
// The total number of processed blocks // The total number of processed blocks
blocks metrics.Counter blocks metrics.Counter
// The total number of processed transactions // The total number of processed transactions
@ -45,8 +45,8 @@ type indexerMetricsContext struct {
tStateStoreCodeProcessing metrics.Timer tStateStoreCodeProcessing metrics.Timer
} }
func RegisterIndexerMetrics(reg metrics.Registry) indexerMetricsContext { func RegisterIndexerMetrics(reg metrics.Registry) indexerMetricsHandles {
ctx := indexerMetricsContext{ ctx := indexerMetricsHandles{
blocks: metrics.NewCounter(), blocks: metrics.NewCounter(),
transactions: metrics.NewCounter(), transactions: metrics.NewCounter(),
receipts: metrics.NewCounter(), receipts: metrics.NewCounter(),

View File

@ -519,7 +519,7 @@ func (sds *Service) WriteStateDiffAt(blockNumber uint64, params Params) error {
// Writes a state diff from the current block, parent state root, and provided params // Writes a state diff from the current block, parent state root, and provided params
func (sds *Service) writeStateDiff(block *types.Block, parentRoot common.Hash, params Params) error { func (sds *Service) writeStateDiff(block *types.Block, parentRoot common.Hash, params Params) error {
log.Info("writing state diff", "block height", block.Number().Uint64()) log.Info("Writing state diff", "block height", block.Number().Uint64())
var totalDifficulty *big.Int var totalDifficulty *big.Int
var receipts types.Receipts var receipts types.Receipts
if params.IncludeTD { if params.IncludeTD {