Skip to content

Provide a get_connection_stats() interface. #18

Closed

Description

@lovelydinosaur

We should hide anything except .request and .close on the ConnectionPool, but we might well want to provide a .get_connection_stats() that returns eg...

>>> print(http.get_connection_stats())
{(b'https', b'example.org', 443): {ConnectionState.IDLE: 1}}

Above: A connection pool, maintaining a single keep-alive connection to https://example.org

Noticable in particular in the test cases which happen to reach inside intended-private API in order to deteremine the connection state.

Activity

  1. victoraugustolls commented on Mar 2, 2020

    @victoraugustolls
    Contributor

    would this include making the properties private?

    eg. max_connections -> _max_connections, connection_semaphore -> _connection_semaphore, ...

  2. lovelydinosaur commented on Mar 2, 2020

    @lovelydinosaur
    MemberAuthor

    At this point in time really all the interface on AsyncConnectionPool / SyncConnectionPool ought to be made private, other than request() and .close()/.aclose().

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions