mirror of
https://github.com/netinvent/npbackup.git
synced 2025-09-17 02:16:40 +08:00
Convert bytes to IEC bytes, fixes #143
This commit is contained in:
parent
fc50f783ad
commit
9c9d131b1e
2 changed files with 3 additions and 3 deletions
|
@ -159,7 +159,7 @@ def show_stats(statistics: List[dict]) -> None:
|
|||
|
||||
# --stats output
|
||||
try:
|
||||
total_size = BytesConverter(entry[repo_name]["output"]["total_size"]).human
|
||||
total_size = BytesConverter(entry[repo_name]["output"]["total_size"]).human_iec_bytes
|
||||
total_file_count = entry[repo_name]["output"]["total_file_count"]
|
||||
snapshots_count = entry[repo_name]["output"]["snapshots_count"]
|
||||
stats_type = "std"
|
||||
|
@ -171,7 +171,7 @@ def show_stats(statistics: List[dict]) -> None:
|
|||
pass
|
||||
# --stats --mode raw-data output
|
||||
try:
|
||||
total_size = BytesConverter(entry[repo_name]["output"]["total_size"]).human
|
||||
total_size = BytesConverter(entry[repo_name]["output"]["total_size"]).human_iec_bytes
|
||||
total_uncompressed_size = BytesConverter(
|
||||
entry[repo_name]["output"]["total_uncompressed_size"]
|
||||
).human
|
||||
|
|
|
@ -236,7 +236,7 @@ def restic_json_to_prometheus(
|
|||
try:
|
||||
processed_bytes = BytesConverter(
|
||||
str(restic_json["total_bytes_processed"])
|
||||
).human
|
||||
).human_iec_bytes
|
||||
logger.info(f"Processed {processed_bytes} of data")
|
||||
except Exception as exc:
|
||||
logger.error(f"Cannot find processed bytes: {exc}")
|
||||
|
|
Loading…
Add table
Reference in a new issue