Download quick_test.py from Yuvraj18/dashboard: direct link, hf CLI and curl.
- Browser
- Download file 560 Bytes
-
https://huggingface.co/spaces/Yuvraj18/dashboard/resolve/main/quick_test.py
- Command line
-
hf download hf://spaces/Yuvraj18/dashboard/quick_test.py
-
curl -L -o quick_test.py https://huggingface.co/spaces/Yuvraj18/dashboard/resolve/main/quick_test.py
560 Bytes
| """Quick performance test - single request timing""" | |
| import requests | |
| import time | |
| API_URL = "http://localhost:3000/api/sensor-data" | |
| payload = { | |
| "node_id": "PERF_TEST", | |
| "sensor_Data": { | |
| "type": "ultrasonic", | |
| "distances": [10, 20, 30] | |
| } | |
| } | |
| print("Testing API response time...") | |
| print("-" * 40) | |
| for i in range(5): | |
| start = time.time() | |
| response = requests.post(API_URL, json=payload) | |
| elapsed = (time.time() - start) * 1000 | |
| print(f"Request {i+1}: {elapsed:.2f}ms - Status: {response.status_code}") | |
| print("-" * 40) | |