Implemented statistics. Refactored storage abstractions. Added config options for docker and local storage. Added server service and server updating.
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user