public PKCommand(NpgsqlCommand inner, PKConnection ourConnection, ILogger logger, IMetrics metrics) { Inner = inner; _ourConnection = ourConnection; _logger = logger.ForContext <PKCommand>(); _metrics = metrics; }
public async Task<IPKConnection> Obtain() { // Mark the request (for a handle, I guess) in the metrics _metrics.Measure.Meter.Mark(CoreMetrics.DatabaseRequests); // Create a connection and open it // We wrap it in PKConnection for tracing purposes var conn = new PKConnection(new NpgsqlConnection(_config.Database), _countHolder, _logger, _metrics); await conn.OpenAsync(); return conn; }