Spaces:
Sleeping
Sleeping
File size: 1,134 Bytes
1b02bcf 20fae3a 22b9492 27f63e9 20fae3a 1b02bcf 20fae3a 1b02bcf 83254b4 20fae3a 83254b4 1b02bcf 20fae3a 83254b4 20fae3a 27f63e9 20fae3a 1b02bcf | 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 29 30 31 32 33 34 35 36 37 38 | # modules/sys_diagnostics.py - Minimal Working Version
import psutil
from datetime import datetime
def register_module(app, client, username):
"""Register diagnostics module with FastAPI app"""
from fastapi import APIRouter
router = APIRouter(prefix="/system")
@router.get("/diagnostics/full")
async def full_diagnostics():
"""Simple diagnostics check"""
try:
# Just basic CPU check
cpu = psutil.cpu_percent()
return {
"success": True,
"diagnostics": {
"timestamp": datetime.now().isoformat(),
"health_score": 95,
"cpu_usage": cpu,
"status": "HEALTHY"
}
}
except Exception as e:
return {
"success": False,
"error": str(e),
"message": "Diagnostics failed"
}
app.include_router(router)
print("✅ Diagnostics module registered with FastAPI")
return {"status": "registered"}
# Remove all other functions |