Struct reool::instrumentation::StateCounters [−][src]
pub struct StateCounters { /* fields omitted */ }
Expand description
Simply tracks the following values:
- number of existing connections
- number of idle connections
- number of in flight connections
- number of reservations
- number of tasks waiting before the lock
This is mostly useful for testing purposes only.
Call the instrumentation
method to create an
Instrumentation
that can be put into a pool.
The logged or printed output might not be accurate
since there are multiple race conditions possible inside
the StateCounters
. This is desired behaviour to not
block threads. So the values you see in the output
might already have changed to something different when
logged.
Implementations
Create a new StateCounter
.
This method checks the environment:
- If an env var “PRINT” is set, counter changes will be printed to stdout.
- If an env var “LOG” or “RUST_LOG” is set counter changes will be logged at info level
Log counter changes at info level
Print counter changes to stdout
Create the Instrumentation
to be put into the pool to instrument.
Trait Implementations
Returns the “default value” for a type. Read more
Auto Trait Implementations
impl RefUnwindSafe for StateCounters
impl Send for StateCounters
impl Sync for StateCounters
impl Unpin for StateCounters
impl UnwindSafe for StateCounters
Blanket Implementations
Mutably borrows from an owned value. Read more