From f51a38f30689f622d502c74de5d773f7716821e7 Mon Sep 17 00:00:00 2001 From: Vegard Stikbakke Date: Thu, 27 Jun 2024 14:58:37 +0200 Subject: [PATCH] Add more info to the 'Sent blocks' main log message (#40) --- ingester/mainloop.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/ingester/mainloop.go b/ingester/mainloop.go index a47d393..6277f65 100644 --- a/ingester/mainloop.go +++ b/ingester/mainloop.go @@ -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 @@ -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 }