add performance logging on demand, fix minion issues

This commit is contained in:
rootdarkarchon
2023-02-19 16:11:40 +01:00
parent 6cf0ecdef1
commit 44450b24b4
29 changed files with 580 additions and 294 deletions

View File

@@ -156,7 +156,7 @@ public class MarePlugin : MediatorSubscriberBase, IDisposable
}
catch (Exception ex)
{
_logger?.LogWarning(ex.Message);
_logger?.LogCritical(ex, "Error during launch of managers");
}
}
@@ -203,6 +203,17 @@ public class MarePlugin : MediatorSubscriberBase, IDisposable
{
_serviceProvider.GetRequiredService<PeriodicFileScanner>().InvokeScan(forced: true);
}
else if (string.Equals(splitArgs[0], "perf", StringComparison.OrdinalIgnoreCase))
{
if (splitArgs.Length > 1 && int.TryParse(splitArgs[1], out var limitBySeconds))
{
_serviceProvider.GetRequiredService<PerformanceCollector>().PrintPerformanceStats(limitBySeconds);
}
else
{
_serviceProvider.GetRequiredService<PerformanceCollector>().PrintPerformanceStats();
}
}
}
private void OpenUi()