Spaces:
Running
Running
| import requests | |
| import json | |
| BASE_URL = "http://localhost:7860/v1" | |
| def test_metrics(): | |
| print("Checking metrics...") | |
| try: | |
| res = requests.get(f"{BASE_URL}/admin/") | |
| if res.status_code == 200: | |
| print(f"Initial Metrics: {res.json()}") | |
| else: | |
| print(f"Failed to get metrics: {res.status_code}") | |
| except Exception as e: | |
| print(f"Error: {e}") | |
| def test_health(): | |
| print("Checking health...") | |
| try: | |
| res = requests.get("http://localhost:7860/health") | |
| print(f"Health: {res.status_code}") | |
| except Exception as e: | |
| print(f"Error: {e}") | |
| if __name__ == "__main__": | |
| test_health() | |
| test_metrics() | |