Skip to content

Commit

Permalink
add logs
Browse files Browse the repository at this point in the history
  • Loading branch information
MonikaCat committed Sep 14, 2023
1 parent f03da20 commit 33ba1a3
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions parser/worker.go
Original file line number Diff line number Diff line change
Expand Up @@ -109,25 +109,38 @@ func (w Worker) Process(height int64) error {

w.logger.Debug("processing block", "height", height)

// w.logger.Error("***** Processing block **********", "module", module.Name(), "height", b.Block.Height)
start := time.Now()
block, err := w.node.Block(height)
if err != nil {
return fmt.Errorf("failed to get block from node: %s", err)
}
elapsed := time.Since(start).Seconds()
w.logger.Debug("******** processing block ********", "height", height, "time", elapsed)

start2 := time.Now()
events, err := w.node.BlockResults(height)
if err != nil {
return fmt.Errorf("failed to get block results from node: %s", err)
}
elapsed2 := time.Since(start2).Seconds()
w.logger.Debug("******** processing block results ********", "height", height, "time", elapsed2)

start3 := time.Now()
txs, err := w.node.Txs(block)
if err != nil {
return fmt.Errorf("failed to get transactions for block: %s", err)
}
elapsed3 := time.Since(start3).Seconds()
w.logger.Debug("******** processing transactions for block ********", "height", height, "time", elapsed3)

start4 := time.Now()
vals, err := w.node.Validators(height)
if err != nil {
return fmt.Errorf("failed to get validators for block: %s", err)
}
elapsed4 := time.Since(start4).Seconds()
w.logger.Debug("******** processing validators for block ********", "height", height, "time", elapsed4)

return w.ExportBlock(block, events, txs, vals)
}
Expand Down

0 comments on commit 33ba1a3

Please sign in to comment.