mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-02-03 09:45:22 +03:00
Make keys consistent
This commit is contained in:
parent
bc205ad47d
commit
cc7bae68d3
@ -800,11 +800,9 @@ def get_amd_gpu_stats() -> dict[str, str]:
|
||||
|
||||
for hw in usages:
|
||||
if "gpu" in hw:
|
||||
results["gpu_usage"] = f"{hw.strip().split(' ')[1].replace('%', '')} %"
|
||||
results["gpu"] = f"{hw.strip().split(' ')[1].replace('%', '')} %"
|
||||
elif "vram" in hw:
|
||||
results[
|
||||
"memory_usage"
|
||||
] = f"{hw.strip().split(' ')[1].replace('%', '')} %"
|
||||
results["mem"] = f"{hw.strip().split(' ')[1].replace('%', '')} %"
|
||||
|
||||
return results
|
||||
|
||||
@ -846,10 +844,10 @@ def get_intel_gpu_stats() -> dict[str, str]:
|
||||
),
|
||||
2,
|
||||
)
|
||||
results["gpu_usage"] = f"{gpu_usage} %"
|
||||
results["gpu"] = f"{gpu_usage} %"
|
||||
break
|
||||
|
||||
results["memory_usage"] = "- %"
|
||||
results["mem"] = "- %"
|
||||
return results
|
||||
|
||||
|
||||
@ -875,8 +873,8 @@ def get_nvidia_gpu_stats() -> dict[str, str]:
|
||||
memory_percent = f"{round(float(usages[2].replace(' MiB', '').strip()) / float(usages[3].replace(' MiB', '').strip()) * 100, 1)} %"
|
||||
results: dict[str, str] = {
|
||||
"name": usages[0],
|
||||
"gpu_usage": usages[1].strip(),
|
||||
"memory_usage": memory_percent,
|
||||
"gpu": usages[1].strip(),
|
||||
"mem": memory_percent,
|
||||
}
|
||||
|
||||
return results
|
||||
|
||||
@ -157,7 +157,7 @@ export default function System() {
|
||||
<Tbody>
|
||||
<Tr>
|
||||
<Td>{gpu_usages[gpu]['gpu']}</Td>
|
||||
<Td>{gpu_usages[gpu]['memory']}</Td>
|
||||
<Td>{gpu_usages[gpu]['mem']}</Td>
|
||||
</Tr>
|
||||
</Tbody>
|
||||
</Table>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user