private void Handle(ConnectionPoolAddedConnectionEvent @event) { ConnectionPoolPerformanceRecorder recorder; if (_connectionPoolRecorders.TryGetValue(@event.ServerId, out recorder)) { recorder.ConnectionAdded(); } }
private void FinishCreating() { _stopwatch.Stop(); var connectionAddedEvent = new ConnectionPoolAddedConnectionEvent(_connection.ConnectionId, _stopwatch.Elapsed, EventContext.OperationId); _pool._addedConnectionEventHandler?.Invoke(connectionAddedEvent); // Only if reached this stage, connection should not be disposed _disposeConnection = false; }
private void FinishCreating(ConnectionDescription description) { _stopwatch.Stop(); var connectionAddedEvent = new ConnectionPoolAddedConnectionEvent(_connection.ConnectionId, _stopwatch.Elapsed, EventContext.OperationId); _pool._addedConnectionEventHandler?.Invoke(connectionAddedEvent); // Only if reached this stage, connection should not be disposed _disposeConnection = false; _pool._serviceStates.IncrementConnectionCount(description?.ServiceId); }
private void Handle(ConnectionPoolAddedConnectionEvent @event) { Debug(TraceSourceEventHelper.ConnectionPoolIdBase + 5, "{0}-pool: added connection {1} in {2}ms.", TraceSourceEventHelper.Label(@event.ConnectionId.ServerId), TraceSourceEventHelper.Format(@event.ConnectionId), @event.Duration.TotalMilliseconds); }