org.apache.hc.core5.pool

## Class PoolStats

- java.lang.Object
- - org.apache.hc.core5.pool.PoolStats

- All Implemented Interfaces:
    Serializable

      @Contract(threading=IMMUTABLE)
      public class PoolStats
      extends Object
      implements Serializable

  Pool statistics.

  The total number of connections in the pool is equal to `available` plus `leased`.

  Since:
    4.2
  See Also:
    Serialized Form

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `PoolStats(int leased, int pending, int free, int max)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `int` | `getAvailable()` Gets the number idle persistent connections.
    `int` | `getLeased()` Gets the number of persistent connections tracked by the connection manager currently being used to execute requests.
    `int` | `getMax()` Gets the maximum number of allowed persistent connections.
    `int` | `getPending()` Gets the number of connection requests being blocked awaiting a free connection.
    `String` | `toString()`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Constructor Detail

    - #### PoolStats

          public PoolStats(int leased,
                           int pending,
                           int free,
                           int max)

  - ### Method Detail

    - #### getLeased

          public int getLeased()

      Gets the number of persistent connections tracked by the connection manager currently being used to execute requests.

      The total number of connections in the pool is equal to `available` plus `leased`.

      Returns:
        the number of persistent connections.

    - #### getPending

          public int getPending()

      Gets the number of connection requests being blocked awaiting a free connection. This can happen only if there are more worker threads contending for fewer connections.
      Returns:
        the number of connection requests being blocked awaiting a free connection.

    - #### getAvailable

          public int getAvailable()

      Gets the number idle persistent connections.

      The total number of connections in the pool is equal to `available` plus `leased`.

      Returns:
        number idle persistent connections.

    - #### getMax

          public int getMax()

      Gets the maximum number of allowed persistent connections.
      Returns:
        the maximum number of allowed persistent connections.

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

Copyright © 2005–2021 The Apache Software Foundation. All rights reserved.