From 0435bee3da8ea0aa0ab2fd3b6266a200057204bd Mon Sep 17 00:00:00 2001 From: Sergey Krashevich Date: Sun, 11 Jun 2023 17:51:13 +0300 Subject: [PATCH] "Refactor storage stats calculation to use powers of 2 for more accurate values" --- frigate/stats.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/frigate/stats.py b/frigate/stats.py index 246f74bf1..d18642dfe 100644 --- a/frigate/stats.py +++ b/frigate/stats.py @@ -286,9 +286,9 @@ def stats_snapshot( stats["service"]["storage"][path] = {} stats["service"]["storage"][path] = { - "total": round(storage_stats.total / 1000000, 1), - "used": round(storage_stats.used / 1000000, 1), - "free": round(storage_stats.free / 1000000, 1), + "total": round(storage_stats.total / pow(2, 20), 1), + "used": round(storage_stats.used / pow(2, 20), 1), + "free": round(storage_stats.free / pow(2, 20), 1), "mount_type": get_fs_type(path), }