mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-12-16 05:53:03 +03:00
Use stopwatch for more accurate measurements and reduce log spam
DateTime.Now is suitible for small timespans Replaced the needlessly complex and verbose logging for the httpserver
This commit is contained in:
@@ -550,16 +550,18 @@ namespace Emby.Server.Implementations
|
||||
|
||||
var entryPoints = GetExports<IServerEntryPoint>();
|
||||
|
||||
var now = DateTime.UtcNow;
|
||||
var stopWatch = new Stopwatch();
|
||||
stopWatch.Start();
|
||||
await Task.WhenAll(StartEntryPoints(entryPoints, true));
|
||||
Logger.LogInformation("Executed all pre-startup entry points in {Elapsed:fff} ms", DateTime.Now - now);
|
||||
Logger.LogInformation("Executed all pre-startup entry points in {Elapsed:fff} ms", stopWatch.Elapsed);
|
||||
|
||||
Logger.LogInformation("Core startup complete");
|
||||
HttpServer.GlobalResponse = null;
|
||||
|
||||
now = DateTime.UtcNow;
|
||||
stopWatch.Restart();
|
||||
await Task.WhenAll(StartEntryPoints(entryPoints, false));
|
||||
Logger.LogInformation("Executed all post-startup entry points in {Elapsed:fff} ms", DateTime.Now - now);
|
||||
Logger.LogInformation("Executed all post-startup entry points in {Elapsed:fff} ms", stopWatch.Elapsed);
|
||||
stopWatch.Stop();
|
||||
}
|
||||
|
||||
private IEnumerable<Task> StartEntryPoints(IEnumerable<IServerEntryPoint> entryPoints, bool isBeforeStartup)
|
||||
|
||||
Reference in New Issue
Block a user