MCPcopy
hub / github.com/redis/redis-py / record_connection_create_time

Function record_connection_create_time

redis/asyncio/observability/recorder.py:148–169  ·  view source on GitHub ↗

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,
)

Source from the content-addressed store, hash-verified

146
147
148async 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
172async def record_connection_count(

Callers 2

get_connectionMethod · 0.90
get_connectionMethod · 0.90

Calls 2

_get_or_create_collectorFunction · 0.70

Tested by

no test coverage detected