Fix divide by zero

This commit is contained in:
Nicolas Mowen 2024-10-10 06:15:00 -06:00
parent e203318ca6
commit 1e6ee1a636

View File

@ -318,6 +318,7 @@ def get_intel_gpu_stats() -> dict[str, str]:
if video_frame is not None:
video[key].append(float(video_frame))
if render["global"]:
results["gpu"] = (
f"{round(((sum(render['global']) / len(render['global'])) + (sum(video['global']) / len(video['global']))) / 2, 2)}%"
)