Skip to content

Remove IKestrelTrace #37242

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
Oct 6, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public ConnectionDispatcher(ServiceContext serviceContext, Func<T, Task> connect
_transportConnectionManager = transportConnectionManager;
}

private IKestrelTrace Log => _serviceContext.Log;
private KestrelTrace Log => _serviceContext.Log;

public Task StartAcceptingConnections(IConnectionListener<T> listener)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ internal class Http1OutputProducer : IHttpOutputProducer, IDisposable
private readonly string _connectionId;
private readonly BaseConnectionContext _connectionContext;
private readonly MemoryPool<byte> _memoryPool;
private readonly IKestrelTrace _log;
private readonly KestrelTrace _log;
private readonly IHttpMinResponseDataRateFeature _minResponseDataRateFeature;
private readonly IHttpOutputAborter _outputAborter;
private readonly TimingPipeFlusher _flusher;
Expand Down Expand Up @@ -78,7 +78,7 @@ public Http1OutputProducer(
string connectionId,
BaseConnectionContext connectionContext,
MemoryPool<byte> memoryPool,
IKestrelTrace log,
KestrelTrace log,
ITimeoutControl timeoutControl,
IHttpMinResponseDataRateFeature minResponseDataRateFeature,
IHttpOutputAborter outputAborter)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ public void Initialize(HttpConnectionContext context)
public IFeatureCollection ConnectionFeatures => _context.ConnectionFeatures;
public IHttpOutputProducer Output { get; protected set; } = default!;

protected IKestrelTrace Log => ServiceContext.Log;
protected KestrelTrace Log => ServiceContext.Log;
private DateHeaderValueManager DateHeaderValueManager => ServiceContext.DateHeaderValueManager;
// Hold direct reference to ServerOptions since this is used very often in the request processing path
protected KestrelServerOptions ServerOptions { get; set; } = default!;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ protected MessageBody(HttpProtocol context)

public virtual bool IsEmpty => false;

protected IKestrelTrace Log => _context.ServiceContext.Log;
protected KestrelTrace Log => _context.ServiceContext.Log;

public abstract ValueTask<ReadResult> ReadAsync(CancellationToken cancellationToken = default);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ public Http2Connection(HttpConnectionContext context)

public PipeReader Input => _input.Reader;

public IKestrelTrace Log => _context.ServiceContext.Log;
public KestrelTrace Log => _context.ServiceContext.Log;
public IFeatureCollection ConnectionFeatures => _context.ConnectionFeatures;
public ISystemClock SystemClock => _context.ServiceContext.SystemClock;
public ITimeoutControl TimeoutControl => _context.TimeoutControl;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ internal class Http2FrameWriter
private readonly Http2Connection _http2Connection;
private readonly OutputFlowControl _connectionOutputFlowControl;
private readonly string _connectionId;
private readonly IKestrelTrace _log;
private readonly KestrelTrace _log;
private readonly ITimeoutControl _timeoutControl;
private readonly MinDataRate? _minResponseDataRate;
private readonly TimingPipeFlusher _flusher;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ internal class Http2OutputProducer : IHttpOutputProducer, IHttpOutputAborter, IV
private int StreamId => _stream.StreamId;
private readonly Http2FrameWriter _frameWriter;
private readonly TimingPipeFlusher _flusher;
private readonly IKestrelTrace _log;
private readonly KestrelTrace _log;

// This should only be accessed via the FrameWriter. The connection-level output flow control is protected by the
// FrameWriter's connection-level write lock.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ private void UpdateHighestOpenedRequestStreamId(long streamId)
// https://quicwg.org/base-drafts/draft-ietf-quic-http.html#section-5.2-2
private long GetCurrentGoAwayStreamId() => Interlocked.Read(ref _highestOpenedRequestStreamId) + 4;

private IKestrelTrace Log => _context.ServiceContext.Log;
private KestrelTrace Log => _context.ServiceContext.Log;
public KestrelServerLimits Limits => _context.ServiceContext.ServerOptions.Limits;
public Http3ControlStream? OutboundControlStream { get; set; }
public Http3ControlStream? ControlStream { get; set; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ private void OnStreamClosed()
}

public PipeReader Input => _context.Transport.Input;
public IKestrelTrace Log => _context.ServiceContext.Log;
public KestrelTrace Log => _context.ServiceContext.Log;

public long StreamTimeoutTicks { get; set; }
public bool IsReceivingHeader => _headerType == -1;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ internal class Http3FrameWriter
private readonly ITimeoutControl _timeoutControl;
private readonly MinDataRate? _minResponseDataRate;
private readonly MemoryPool<byte> _memoryPool;
private readonly IKestrelTrace _log;
private readonly KestrelTrace _log;
private readonly IStreamIdFeature _streamIdFeature;
private readonly IHttp3Stream _http3Stream;
private readonly Http3RawFrame _outgoingFrame;
Expand All @@ -61,7 +61,7 @@ internal class Http3FrameWriter
private bool _completed;
private bool _aborted;

public Http3FrameWriter(ConnectionContext connectionContext, ITimeoutControl timeoutControl, MinDataRate? minResponseDataRate, MemoryPool<byte> memoryPool, IKestrelTrace log, IStreamIdFeature streamIdFeature, Http3PeerSettings clientPeerSettings, IHttp3Stream http3Stream)
public Http3FrameWriter(ConnectionContext connectionContext, ITimeoutControl timeoutControl, MinDataRate? minResponseDataRate, MemoryPool<byte> memoryPool, KestrelTrace log, IStreamIdFeature streamIdFeature, Http3PeerSettings clientPeerSettings, IHttp3Stream http3Stream)
{
_connectionContext = connectionContext;
_timeoutControl = timeoutControl;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ internal class Http3OutputProducer : IHttpOutputProducer, IHttpOutputAborter
{
private readonly Http3FrameWriter _frameWriter;
private readonly TimingPipeFlusher _flusher;
private readonly IKestrelTrace _log;
private readonly KestrelTrace _log;
private readonly MemoryPool<byte> _memoryPool;
private readonly Http3Stream _stream;
private readonly Pipe _pipe;
Expand All @@ -40,7 +40,7 @@ public Http3OutputProducer(
Http3FrameWriter frameWriter,
MemoryPool<byte> pool,
Http3Stream stream,
IKestrelTrace log)
KestrelTrace log)
{
_frameWriter = frameWriter;
_memoryPool = pool;
Expand Down
2 changes: 1 addition & 1 deletion src/Servers/Kestrel/Core/src/Internal/HttpConnection.cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public HttpConnection(BaseHttpConnectionContext context)
_context.TimeoutControl ??= _timeoutControl;
}

private IKestrelTrace Log => _context.ServiceContext.Log;
private KestrelTrace Log => _context.ServiceContext.Log;

public async Task ProcessRequestsAsync<TContext>(IHttpApplication<TContext> httpApplication) where TContext : notnull
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@ internal class ConnectionManager
private long _lastConnectionId = long.MinValue;

private readonly ConcurrentDictionary<long, ConnectionReference> _connectionReferences = new ConcurrentDictionary<long, ConnectionReference>();
private readonly IKestrelTrace _trace;
private readonly KestrelTrace _trace;

public ConnectionManager(IKestrelTrace trace, long? upgradedConnectionLimit)
public ConnectionManager(KestrelTrace trace, long? upgradedConnectionLimit)
: this(trace, GetCounter(upgradedConnectionLimit))
{
}

public ConnectionManager(IKestrelTrace trace, ResourceCounter upgradedConnections)
public ConnectionManager(KestrelTrace trace, ResourceCounter upgradedConnections)
{
UpgradedConnectionCount = upgradedConnections;
_trace = trace;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ internal class Heartbeat : IDisposable
private readonly IHeartbeatHandler[] _callbacks;
private readonly ISystemClock _systemClock;
private readonly IDebugger _debugger;
private readonly IKestrelTrace _trace;
private readonly KestrelTrace _trace;
private readonly TimeSpan _interval;
private readonly Thread _timerThread;
private volatile bool _stopped;

public Heartbeat(IHeartbeatHandler[] callbacks, ISystemClock systemClock, IDebugger debugger, IKestrelTrace trace)
public Heartbeat(IHeartbeatHandler[] callbacks, ISystemClock systemClock, IDebugger debugger, KestrelTrace trace)
{
_callbacks = callbacks;
_systemClock = systemClock;
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ internal abstract class KestrelConnection : IConnectionHeartbeatFeature, IConnec
public KestrelConnection(long id,
ServiceContext serviceContext,
TransportConnectionManager transportConnectionManager,
IKestrelTrace logger)
KestrelTrace logger)
{
_id = id;
_serviceContext = serviceContext;
Expand All @@ -38,7 +38,7 @@ public KestrelConnection(long id,
ConnectionClosedRequested = _connectionClosingCts.Token;
}

protected IKestrelTrace Logger { get; }
protected KestrelTrace Logger { get; }

public CancellationToken ConnectionClosedRequested { get; set; }
public Task ExecutionTask => _completionTcs.Task;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public KestrelConnection(long id,
TransportConnectionManager transportConnectionManager,
Func<T, Task> connectionDelegate,
T connectionContext,
IKestrelTrace logger)
KestrelTrace logger)
: base(id, serviceContext, transportConnectionManager, logger)
{
_connectionDelegate = connectionDelegate;
Expand Down
Loading