mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-02-05 02:35:22 +03:00
remove space before gpu statistic values
This commit is contained in:
parent
e156ae7585
commit
c0cadf280f
@ -17,7 +17,7 @@ class TestGpuStats(unittest.TestCase):
|
||||
process.stdout = self.amd_results
|
||||
sp.return_value = process
|
||||
amd_stats = get_amd_gpu_stats()
|
||||
assert amd_stats == {"gpu": "4.17 %", "mem": "60.37 %"}
|
||||
assert amd_stats == {"gpu": "4.17%", "mem": "60.37%"}
|
||||
|
||||
# @patch("subprocess.run")
|
||||
# def test_nvidia_gpu_stats(self, sp):
|
||||
@ -40,6 +40,6 @@ class TestGpuStats(unittest.TestCase):
|
||||
sp.return_value = process
|
||||
intel_stats = get_intel_gpu_stats()
|
||||
assert intel_stats == {
|
||||
"gpu": "1.34 %",
|
||||
"mem": "- %",
|
||||
"gpu": "1.34%",
|
||||
"mem": "-%",
|
||||
}
|
||||
|
||||
@ -853,9 +853,9 @@ def get_amd_gpu_stats() -> dict[str, str]:
|
||||
|
||||
for hw in usages:
|
||||
if "gpu" in hw:
|
||||
results["gpu"] = f"{hw.strip().split(' ')[1].replace('%', '')} %"
|
||||
results["gpu"] = f"{hw.strip().split(' ')[1].replace('%', '')}%"
|
||||
elif "vram" in hw:
|
||||
results["mem"] = f"{hw.strip().split(' ')[1].replace('%', '')} %"
|
||||
results["mem"] = f"{hw.strip().split(' ')[1].replace('%', '')}%"
|
||||
|
||||
return results
|
||||
|
||||
@ -911,8 +911,8 @@ def get_intel_gpu_stats() -> dict[str, str]:
|
||||
else:
|
||||
video_avg = 1
|
||||
|
||||
results["gpu"] = f"{round((video_avg + render_avg) / 2, 2)} %"
|
||||
results["mem"] = "- %"
|
||||
results["gpu"] = f"{round((video_avg + render_avg) / 2, 2)}%"
|
||||
results["mem"] = "-%"
|
||||
return results
|
||||
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user