added debug info.

This commit is contained in:
taywon 2024-05-19 17:28:04 +02:00
parent 188d8f48e3
commit 01af7a3e36
2 changed files with 18 additions and 0 deletions

View File

@ -179,4 +179,21 @@ public class StateMachine
return null;
}
public long CountTriplets()
{
lock(Mutex)
{
if (!Populated)
PopulateWithHistory().Wait();
long c = 0;
foreach (var kv in Implementation)
foreach (var i in kv.Key)
c++;
return c;
}
}
}

View File

@ -34,6 +34,7 @@ Console.WriteLine("Connected to Mongo database.");
CoreInstance.Persistence = dbInterface;
CoreInstance.State.History = dbInterface;
await CoreInstance.State.PopulateWithHistory();
Console.WriteLine($"Populated with {CoreInstance.State.CountTriplets()} triplets");
builder.Services.AddSingleton(dbInterface);
builder.Services.AddSingleton(new CurrentSoftwareRefresher(CoreInstance));