bsure-api / scripts /debug_measurements.py
“mohansree14”
Deploy Bsure API with correct structure
af1d8cd
Raw History Blame Contribute Delete
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()