Spaces:
Sleeping
Sleeping
File size: 711 Bytes
5e927fc | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 | 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()
|