Download scripts/debug_measurements.py from Mohansree/bsure-api: direct link, hf CLI and curl.
- Browser
- Download file 843 Bytes
-
https://huggingface.co/spaces/Mohansree/bsure-api/resolve/main/scripts/debug_measurements.py
- Command line
-
hf download hf://spaces/Mohansree/bsure-api/scripts/debug_measurements.py
-
curl -L -o debug_measurements.py https://huggingface.co/spaces/Mohansree/bsure-api/resolve/main/scripts/debug_measurements.py
843 Bytes
| import requests | |
| import time | |
| def debug_api(): | |
| print("Testing Size API...") | |
| try: | |
| # 1. Health check | |
| t0 = time.time() | |
| print("1. Pinging /health...") | |
| res = requests.get("http://localhost:8000/health", timeout=5) | |
| print(f" Response: {res.status_code} in {time.time() - t0:.2f}s") | |
| # 2. Measurements endpoint | |
| print("\n2. Pinging /size/measurements/1 ...") | |
| t0 = time.time() | |
| res = requests.get("http://localhost:8000/size/measurements/1", timeout=5) | |
| print(f" Response: {res.status_code} in {time.time() - t0:.2f}s") | |
| print(f" Body: {res.text[:100]}") | |
| except Exception as e: | |
| print(f"❌ API Check Failed: {e}") | |
| print("Possibility: Backend server is hung or deadlocked.") | |
| if __name__ == "__main__": | |
| debug_api() | |