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 a copy of the value. Read more

Performs copy-assignment from source. Read more

Returns the “default value” for a type. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.