Skip to content

Commit

Permalink
added block push duration
Browse files Browse the repository at this point in the history
  • Loading branch information
billettc committed Oct 2, 2023
1 parent 804b654 commit b4f72f5
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions accountresolver/processor.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ type stats struct {
totalBlockHandlingDuration time.Duration
totalBlockReadingDuration time.Duration
cacheHit int
totalBlockPushDuration time.Duration
}

func (s *stats) log(logger *zap.Logger) {
Expand All @@ -59,6 +60,7 @@ func (s *stats) log(logger *zap.Logger) {
zap.String("total_block_handling_duration", durafmt.Parse(s.totalBlockHandlingDuration).String()),
zap.String("total_block_processing_duration", durafmt.Parse(s.totalBlockProcessingDuration).String()),
zap.String("total_transaction_processing_duration", durafmt.Parse(s.totalTransactionProcessingDuration).String()),
zap.String("total_push_duration", durafmt.Parse(s.totalBlockPushDuration).String()),
zap.String("total_lookup_duration", durafmt.Parse(s.totalLookupDuration).String()),
zap.String("total_extend_duration", durafmt.Parse(s.totalExtendDuration).String()),
zap.String("total_duration", durafmt.Parse(time.Since(s.startProcessing)).String()),
Expand Down Expand Up @@ -238,10 +240,12 @@ func (p *Processor) processMergeBlocksFiles(ctx context.Context, mergeBlocksFile
go func() {
for bb := range nailer.Out {
err := bundleReader.PushBlock(bb)
pushStart := time.Now()
if err != nil {
bundleReader.PushError(fmt.Errorf("pushing block to bundle reader: %w", err))
return
}
p.stats.totalBlockPushDuration += time.Since(pushStart)
}
bundleReader.Close()
}()
Expand Down

0 comments on commit b4f72f5

Please sign in to comment.