diff --git a/src/Microsoft.AspNetCore.Http.Connections/Internal/HttpConnectionManager.Log.cs b/src/Microsoft.AspNetCore.Http.Connections/Internal/HttpConnectionManager.Log.cs index 7f542b920e..46899492bd 100644 --- a/src/Microsoft.AspNetCore.Http.Connections/Internal/HttpConnectionManager.Log.cs +++ b/src/Microsoft.AspNetCore.Http.Connections/Internal/HttpConnectionManager.Log.cs @@ -25,14 +25,12 @@ namespace Microsoft.AspNetCore.Http.Connections.Internal private static readonly Action _connectionTimedOut = LoggerMessage.Define(LogLevel.Trace, new EventId(5, "ConnectionTimedOut"), "Connection {TransportConnectionId} timed out."); - private static readonly Action _scanningConnections = - LoggerMessage.Define(LogLevel.Trace, new EventId(6, "ScanningConnections"), "Scanning connections."); + // 6, ScanningConnections - removed private static readonly Action _scanningConnectionsFailed = LoggerMessage.Define(LogLevel.Error, new EventId(7, "ScanningConnectionsFailed"), "Scanning connections failed."); - private static readonly Action _scannedConnections = - LoggerMessage.Define(LogLevel.Trace, new EventId(8, "ScannedConnections"), "Scanned connections in {Duration}."); + // 8, ScannedConnections - removed private static readonly Action _heartbeatStarted = LoggerMessage.Define(LogLevel.Trace, new EventId(9, "HeartBeatStarted"), "Starting connection heartbeat."); @@ -65,21 +63,11 @@ namespace Microsoft.AspNetCore.Http.Connections.Internal _connectionReset(logger, connectionId, exception); } - public static void ScanningConnections(ILogger logger) - { - _scanningConnections(logger, null); - } - public static void ScanningConnectionsFailed(ILogger logger, Exception exception) { _scanningConnectionsFailed(logger, exception); } - public static void ScannedConnections(ILogger logger, TimeSpan duration) - { - _scannedConnections(logger, duration, null); - } - public static void HeartBeatStarted(ILogger logger) { _heartbeatStarted(logger, null); diff --git a/src/Microsoft.AspNetCore.Http.Connections/Internal/HttpConnectionManager.cs b/src/Microsoft.AspNetCore.Http.Connections/Internal/HttpConnectionManager.cs index e1851a1a90..104d074003 100644 --- a/src/Microsoft.AspNetCore.Http.Connections/Internal/HttpConnectionManager.cs +++ b/src/Microsoft.AspNetCore.Http.Connections/Internal/HttpConnectionManager.cs @@ -131,11 +131,6 @@ namespace Microsoft.AspNetCore.Http.Connections.Internal public async Task ScanAsync() { - // Time the scan so we know if it gets slower than 1sec - var timer = ValueStopwatch.StartNew(); - HttpConnectionsEventSource.Log.ScanningConnections(); - Log.ScanningConnections(_logger); - // Scan the registered connections looking for ones that have timed out foreach (var c in _connections) { @@ -175,10 +170,6 @@ namespace Microsoft.AspNetCore.Http.Connections.Internal connection.TickHeartbeat(); } } - - var elapsed = timer.GetElapsedTime(); - HttpConnectionsEventSource.Log.ScannedConnections(elapsed); - Log.ScannedConnections(_logger, elapsed); } public void CloseConnections() diff --git a/src/Microsoft.AspNetCore.Http.Connections/Internal/HttpConnectionsEventSource.cs b/src/Microsoft.AspNetCore.Http.Connections/Internal/HttpConnectionsEventSource.cs index 6ee256dbe2..96a5ca36b6 100644 --- a/src/Microsoft.AspNetCore.Http.Connections/Internal/HttpConnectionsEventSource.cs +++ b/src/Microsoft.AspNetCore.Http.Connections/Internal/HttpConnectionsEventSource.cs @@ -43,15 +43,6 @@ namespace Microsoft.AspNetCore.Http.Connections.Internal } } - [NonEvent] - public void ScannedConnections(TimeSpan duration) - { - if (IsEnabled() && IsEnabled(EventLevel.Verbose, EventKeywords.None)) - { - ScannedConnections(duration.TotalMilliseconds); - } - } - [Event(eventId: 1, Level = EventLevel.Informational, Message = "Started connection '{0}'.")] public ValueStopwatch ConnectionStart(string connectionId) { @@ -85,16 +76,8 @@ namespace Microsoft.AspNetCore.Http.Connections.Internal } } - [Event(eventId: 4, Level = EventLevel.Verbose, Message = "Scanning connections.")] - public void ScanningConnections() - { - if (IsEnabled() && IsEnabled(EventLevel.Verbose, EventKeywords.None)) - { - WriteEvent(4); - } - } + // 4, ScanningConnections - removed - [Event(eventId: 5, Level = EventLevel.Verbose, Message = "Finished scanning connections. Duration: {0:0.00}ms.")] - private void ScannedConnections(double durationInMilliseconds) => WriteEvent(5, durationInMilliseconds); + // 5, ScannedConnections - removed } }