Implemented statistics. Refactored storage abstractions. Added config options for docker and local storage. Added server service and server updating.

This commit is contained in:
2026-03-02 15:51:05 +00:00
parent 52dbd13fb5
commit 2d1b48b0d4
27 changed files with 493 additions and 147 deletions

View File

@@ -67,11 +67,12 @@ public partial class Server : IAsyncDisposable
private async Task OnConsoleMessageAsync(string message)
{
Console.WriteLine($"Console: {message}");
Console.Write($"Console: {message}");
}
private async Task OnStatisticsReceivedAsync(ServerStatistics statistics)
{
Logger.LogTrace("{cpu:F} {used:F} {total:F}", statistics.CpuUsage, statistics.UsedMemory / 1024 / 1024, statistics.TotalMemory / 1024 / 1024);
}
private Task ChangeStateAsync(ServerState newState)
@@ -88,7 +89,7 @@ public partial class Server : IAsyncDisposable
if (RuntimeEnvironment != null)
{
Logger.LogTrace("Detaching and disposing runtime environment");
Logger.LogTrace("Detaching events and disposing runtime environment");
RuntimeEnvironment.Console.OnOutput -= OnConsoleMessageAsync;
RuntimeEnvironment.Statistics.OnStatisticsReceived -= OnStatisticsReceivedAsync;
@@ -99,7 +100,7 @@ public partial class Server : IAsyncDisposable
if (InstallEnvironment != null)
{
Logger.LogTrace("Detaching and disposing install environment");
Logger.LogTrace("Detaching events and disposing install environment");
InstallEnvironment.Console.OnOutput -= OnConsoleMessageAsync;
InstallEnvironment.Statistics.OnStatisticsReceived -= OnStatisticsReceivedAsync;