"Refactor storage stats calculation to use powers of 2 for more accurate values"

This commit is contained in:
Sergey Krashevich 2023-06-11 17:51:13 +03:00
parent 0f1cf67b91
commit 0435bee3da
No known key found for this signature in database
GPG Key ID: 625171324E7D3856

View File

@ -286,9 +286,9 @@ def stats_snapshot(
stats["service"]["storage"][path] = {} stats["service"]["storage"][path] = {}
stats["service"]["storage"][path] = { stats["service"]["storage"][path] = {
"total": round(storage_stats.total / 1000000, 1), "total": round(storage_stats.total / pow(2, 20), 1),
"used": round(storage_stats.used / 1000000, 1), "used": round(storage_stats.used / pow(2, 20), 1),
"free": round(storage_stats.free / 1000000, 1), "free": round(storage_stats.free / pow(2, 20), 1),
"mount_type": get_fs_type(path), "mount_type": get_fs_type(path),
} }