Skip to content

Commit

Permalink
tracker: log block processing time
Browse files Browse the repository at this point in the history
  • Loading branch information
RaghavSood committed Jun 9, 2024
1 parent c7fdf23 commit 41a7be1
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions tracker/tracker.go
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,7 @@ func (t *Tracker) processScriptQueue() {

func (t *Tracker) processBlock(height int64) error {
log.Info().Int64("block_height", height).Msg("Processing block")
start := time.Now()
blockStats, err := t.client.GetBlockStats(int64(height))
if err != nil {
return err
Expand Down Expand Up @@ -292,6 +293,13 @@ func (t *Tracker) processBlock(height int64) error {
return fmt.Errorf("failed to record block index results: %v", err)
}

elapsed := time.Since(start)
log.Info().
Int64("block_height", height).
Stringer("elapsed", elapsed).
Int("losses", len(losses)).
Msg("Block processed")

return nil
}

Expand Down

0 comments on commit 41a7be1

Please sign in to comment.