Record a connection count change for a single state. Args: pool_name: Connection pool identifier connection_state: State to update (IDLE or USED) counter: Number to add (positive) or subtract (negative)
(
pool_name: str,
connection_state: ConnectionState,
counter: int = 1,
)
| 170 | |
| 171 | |
| 172 | async def record_connection_count( |
| 173 | pool_name: str, |
| 174 | connection_state: ConnectionState, |
| 175 | counter: int = 1, |
| 176 | ) -> None: |
| 177 | """ |
| 178 | Record a connection count change for a single state. |
| 179 | |
| 180 | Args: |
| 181 | pool_name: Connection pool identifier |
| 182 | connection_state: State to update (IDLE or USED) |
| 183 | counter: Number to add (positive) or subtract (negative) |
| 184 | """ |
| 185 | collector = _get_or_create_collector() |
| 186 | if collector is None: |
| 187 | return |
| 188 | |
| 189 | try: |
| 190 | collector.record_connection_count( |
| 191 | pool_name=pool_name, |
| 192 | connection_state=connection_state, |
| 193 | counter=counter, |
| 194 | ) |
| 195 | except Exception: |
| 196 | pass |
| 197 | |
| 198 | |
| 199 | @deprecated_function( |
no test coverage detected