Skip to content

Commit

Permalink
Add more info to the 'Sent blocks' main log message (#40)
Browse files Browse the repository at this point in the history
  • Loading branch information
vegarsti committed Jun 27, 2024
1 parent dc918c7 commit f51a38f
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion ingester/mainloop.go
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,8 @@ func (i *ingester) trySendCompletedBlocks(
collectedBlocks map[int64]models.RPCBlock,
nextBlockToSend int64,
) (int64, error) {
initialNextBlockToSend := nextBlockToSend
startTime := time.Now()
// Outer loop: We might need to send multiple batch requests if our buffer is too big
for _, ok := collectedBlocks[nextBlockToSend]; ok; _, ok = collectedBlocks[nextBlockToSend] {
// Collect a blocks of blocks to send, only send those which are in order
Expand Down Expand Up @@ -258,9 +260,11 @@ func (i *ingester) trySendCompletedBlocks(
atomic.StoreInt64(&i.info.IngestedBlockNumber, lastBlockNumber)
}
i.log.Info(
"Sent completed blocks to DuneAPI",
"Sent blocks to DuneAPI",
"blocksSent", nextBlockToSend-initialNextBlockToSend,
"bufferSize", len(collectedBlocks),
"nextBlockToSend", nextBlockToSend,
"elapsed", time.Since(startTime),
)
return nextBlockToSend, nil
}
Expand Down

0 comments on commit f51a38f

Please sign in to comment.