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

Function check_health

benchmarks/quick_benchmark.py:671–683  ·  view source on GitHub ↗
(api_base_url: str)

Source from the content-addressed store, hash-verified

669
670
671def check_health(api_base_url: str) -> bool:
672 health_url = api_base_url.rstrip("/") + "/health"
673 try:
674 response = requests.get(health_url, timeout=5)
675 if response.status_code == 200:
676 print(f"[HEALTH] {health_url} is healthy.")
677 return True
678 else:
679 print(f"[HEALTH] {health_url} returned status {response.status_code}")
680 return False
681 except Exception as e:
682 print(f"[HEALTH] Failed to connect to {health_url}: {e}")
683 return False
684
685
686def main(args: argparse.Namespace):

Callers 1

benchmarkFunction · 0.85

Calls 2

printFunction · 0.85
getMethod · 0.45

Tested by

no test coverage detected