pub struct Pool { /* private fields */ }Expand description
A deadpool-postgres pool whose clients are instrumented. It
dereferences to deadpool’s Pool.
It also records the conventions’ connection pool metrics, labelled
with db.client.connection.pool.name:
db.client.connection.count, bydb.client.connection.state(idleorused), anddb.client.connection.max;db.client.connection.pending_requests: callers waiting for a connection;db.client.connection.wait_timeanddb.client.connection.use_time, in seconds;db.client.connection.timeouts.
The counts are taken from the pool’s status whenever a client is
taken or returned. These metrics are still in development in the
conventions, so their names may change. The counts carry no unit,
since the metrics facade can’t express {connection}.
Implementations§
Source§impl Pool
impl Pool
Sourcepub fn new(pool: Pool, config: &Config) -> Self
pub fn new(pool: Pool, config: &Config) -> Self
Instrument a pool whose connections are made with config. Its
name in the pool metrics is server.address:server.port/db.namespace,
as the conventions suggest for a pool without one.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Pool
impl !UnwindSafe for Pool
impl Freeze for Pool
impl Send for Pool
impl Sync for Pool
impl Unpin for Pool
impl UnsafeUnpin for Pool
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more