public IConnectionPoolListener CreateConnectionPoolListener(Uri poolUri, IConnectionPool pool) { var acquisitionTimeout = _config.ConnectionAcquisitionTimeout; var poolMetrics = new ConnectionPoolMetrics(poolUri, pool, acquisitionTimeout); var key = poolMetrics.UniqueName; return((IConnectionPoolListener)_poolMetrics.GetOrAdd(key, poolMetrics)); }
public ConnectionPoolMetrics AddPoolMetrics(Uri poolUri, IConnectionPool pool) { var acquisitionTimeout = _config.ConnectionAcquisitionTimeout; var poolMetrics = new ConnectionPoolMetrics(poolUri, pool, acquisitionTimeout); var key = poolMetrics.UniqueName; _poolMetrics.AddOrUpdate(key, poolMetrics, (oldKey, oldValue) => poolMetrics); return(poolMetrics); }
public DriverMetricsManager(Metrics metrics, Uri poolUri, ConnectionPool pool) { Throw.ArgumentNullException.IfNull(metrics, nameof(metrics)); Throw.ArgumentNullException.IfNull(metrics.ConnectionMetrics, nameof(metrics.ConnectionMetrics)); Throw.ArgumentNullException.IfNull(metrics.ConnectionPoolMetrics, nameof(metrics.ConnectionPoolMetrics)); Throw.ArgumentNullException.IfNull(poolUri, nameof(poolUri)); Throw.ArgumentNullException.IfNull(pool, nameof(pool)); _poolMetrics = metrics.AddPoolMetrics(poolUri, pool); _connMetrics = metrics.AddConnMetrics(poolUri); }
public IConnectionPoolListener PutPoolMetrics(string poolId, IConnectionPool pool) { var poolMetrics = new ConnectionPoolMetrics(poolId, pool, this); return(_poolMetrics.GetOrAdd(poolId, poolMetrics)); }