Record connection creation time. Args: connection_pool: Connection pool implementation duration_seconds: Time taken to create connection in seconds
(
connection_pool: "ConnectionPool",
duration_seconds: float,
)
| 146 | |
| 147 | |
| 148 | async def record_connection_create_time( |
| 149 | connection_pool: "ConnectionPool", |
| 150 | duration_seconds: float, |
| 151 | ) -> None: |
| 152 | """ |
| 153 | Record connection creation time. |
| 154 | |
| 155 | Args: |
| 156 | connection_pool: Connection pool implementation |
| 157 | duration_seconds: Time taken to create connection in seconds |
| 158 | """ |
| 159 | collector = _get_or_create_collector() |
| 160 | if collector is None: |
| 161 | return |
| 162 | |
| 163 | try: |
| 164 | collector.record_connection_create_time( |
| 165 | connection_pool=connection_pool, |
| 166 | duration_seconds=duration_seconds, |
| 167 | ) |
| 168 | except Exception: |
| 169 | pass |
| 170 | |
| 171 | |
| 172 | async def record_connection_count( |
no test coverage detected