MCPcopy Create free account
hub / github.com/PaddlePaddle/FastDeploy / send_request

Function send_request

tests/ce/performance/stress_tools.py:40–52  ·  view source on GitHub ↗
(session, payload)

Source from the content-addressed store, hash-verified

38
39# ============ 请求发送 ============
40async def send_request(session, payload):
41 start_time = time.perf_counter()
42 try:
43 async with session.post(API_URL, json=payload) as resp:
44 try:
45 _ = await resp.json()
46 except Exception:
47 _ = await resp.text()
48 latency = time.perf_counter() - start_time
49 return resp.status == 200, latency, resp.status, None if resp.status == 200 else _
50 except Exception as e:
51 latency = time.perf_counter() - start_time
52 return False, latency, None, f"{type(e).__name__}: {e}"
53
54
55# ============ Worker ============

Callers 1

workerFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected