Returns a connection count (both idle and in use).
(self)
| 1735 | pass |
| 1736 | |
| 1737 | def get_connection_count(self) -> List[tuple[int, dict]]: |
| 1738 | """ |
| 1739 | Returns a connection count (both idle and in use). |
| 1740 | """ |
| 1741 | attributes = AttributeBuilder.build_base_attributes() |
| 1742 | attributes[DB_CLIENT_CONNECTION_POOL_NAME] = get_pool_name(self) |
| 1743 | free_connections_attributes = attributes.copy() |
| 1744 | in_use_connections_attributes = attributes.copy() |
| 1745 | |
| 1746 | free_connections_attributes[DB_CLIENT_CONNECTION_STATE] = ( |
| 1747 | ConnectionState.IDLE.value |
| 1748 | ) |
| 1749 | in_use_connections_attributes[DB_CLIENT_CONNECTION_STATE] = ( |
| 1750 | ConnectionState.USED.value |
| 1751 | ) |
| 1752 | |
| 1753 | return [ |
| 1754 | (len(self._available_connections), free_connections_attributes), |
| 1755 | (len(self._in_use_connections), in_use_connections_attributes), |
| 1756 | ] |
| 1757 | |
| 1758 | |
| 1759 | class BlockingConnectionPool(ConnectionPool): |
no test coverage detected