Skip to content

Commit f3f631f

Browse files
committed
~Temporary log completion time
1 parent 7f7dfd0 commit f3f631f

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

src/Nethermind/Nethermind.Facade/Find/LogIndexService.cs

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
using System.Collections.Generic;
77
using System.Diagnostics;
88
using System.Diagnostics.CodeAnalysis;
9+
using System.Text.Json;
910
using System.Threading;
1011
using System.Threading.Channels;
1112
using System.Threading.Tasks;
@@ -81,6 +82,8 @@ public ProcessingQueue(
8182

8283
public string Description => "log index service";
8384

85+
private long _startTimestamp = Stopwatch.GetTimestamp(); // TODO: remove after testing
86+
8487
public LogIndexService(ILogIndexStorage logIndexStorage, ILogIndexConfig config,
8588
IBlockTree blockTree, ISyncConfig syncConfig,
8689
IReceiptFinder receiptFinder, IReceiptStorage receiptStorage,
@@ -133,6 +136,7 @@ public async Task StartAsync()
133136
_logger.Info($"{GetLogPrefix()}: waiting for the first block...");
134137

135138
await _pivotTask;
139+
_startTimestamp = Stopwatch.GetTimestamp();
136140

137141
StartProcessing(isForward: true);
138142
StartProcessing(isForward: false);
@@ -449,7 +453,13 @@ private void MarkCompleted(bool isForward)
449453
progress.MarkEnd();
450454

451455
if (_logger.IsInfo)
452-
_logger.Info($"{GetLogPrefix(isForward)}: completed.");
456+
{
457+
var elapsed = Stopwatch.GetElapsedTime(_startTimestamp);
458+
var config = JsonSerializer.Serialize(_config, JsonSerializerOptions.Default);
459+
var dbSize = _logIndexStorage.GetDbSize();
460+
461+
_logger.Info($"{GetLogPrefix(isForward)}: completed in {elapsed} with DB size of {dbSize} using config {config}.");
462+
}
453463
}
454464

455465
private static int? GetNextBlockNumber(ILogIndexStorage storage, bool isForward)

0 commit comments

Comments
 (0)