MCPcopy Index your code
hub / github.com/python-websockets/websockets / log_latency

Function log_latency

experiments/broadcast/clients.py:14–24  ·  view source on GitHub ↗
(interval)

Source from the content-addressed store, hash-verified

12
13
14async def log_latency(interval):
15 while True:
16 await asyncio.sleep(interval)
17 p = statistics.quantiles(LATENCIES.values(), n=100)
18 print(f"clients = {len(LATENCIES)}")
19 print(
20 f"p50 = {p[49] / 1e6:.1f}ms, "
21 f"p95 = {p[94] / 1e6:.1f}ms, "
22 f"p99 = {p[98] / 1e6:.1f}ms"
23 )
24 print()
25
26
27async def client():

Callers 1

mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…