Spaces:
Sleeping
Sleeping
UPDATE: exportToDashboard
Browse files
analyticsHub/routers/reportingTool.py
CHANGED
|
@@ -27,9 +27,9 @@ async def generateChart(chartDetails: GenerateChartInput, credentials: Annotated
|
|
| 27 |
)
|
| 28 |
gc.collect()
|
| 29 |
memory = psutil.virtual_memory()
|
| 30 |
-
cpuUsage = psutil.cpu_percent(interval=1)
|
| 31 |
print(f"RAM Usage Percentage: {memory.percent}%")
|
| 32 |
-
print(f"Total CPU Usage: {cpuUsage}
|
| 33 |
return JSONResponse(status_code = 200, content = response)
|
| 34 |
else:
|
| 35 |
return JSONResponse(status_code = 498, content = {"status": "ERROR", "errorDetail": "Invalid Token"})
|
|
@@ -50,9 +50,9 @@ async def generatePanelChart(panelChartDetails: PanelChartDetails, credentials:
|
|
| 50 |
)
|
| 51 |
gc.collect()
|
| 52 |
memory = psutil.virtual_memory()
|
| 53 |
-
cpuUsage = psutil.cpu_percent(interval=1)
|
| 54 |
print(f"RAM Usage Percentage: {memory.percent}%")
|
| 55 |
-
print(f"Total CPU Usage: {cpuUsage}
|
| 56 |
return JSONResponse(status_code = 200, content = response)
|
| 57 |
else:
|
| 58 |
return JSONResponse(status_code = 498, content = {"status": "ERROR", "errorDetail": "Invalid Token"})
|
|
|
|
| 27 |
)
|
| 28 |
gc.collect()
|
| 29 |
memory = psutil.virtual_memory()
|
| 30 |
+
cpuUsage = psutil.cpu_percent(interval=1, percpu=True)
|
| 31 |
print(f"RAM Usage Percentage: {memory.percent}%")
|
| 32 |
+
print(f"Total CPU Usage: {cpuUsage}")
|
| 33 |
return JSONResponse(status_code = 200, content = response)
|
| 34 |
else:
|
| 35 |
return JSONResponse(status_code = 498, content = {"status": "ERROR", "errorDetail": "Invalid Token"})
|
|
|
|
| 50 |
)
|
| 51 |
gc.collect()
|
| 52 |
memory = psutil.virtual_memory()
|
| 53 |
+
cpuUsage = psutil.cpu_percent(interval=1, percpu=True)
|
| 54 |
print(f"RAM Usage Percentage: {memory.percent}%")
|
| 55 |
+
print(f"Total CPU Usage: {cpuUsage}")
|
| 56 |
return JSONResponse(status_code = 200, content = response)
|
| 57 |
else:
|
| 58 |
return JSONResponse(status_code = 498, content = {"status": "ERROR", "errorDetail": "Invalid Token"})
|