Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename Resource savings into Resources saved #1000

Merged
merged 1 commit into from
Aug 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions barman/output.py
Original file line number Diff line number Diff line change
Expand Up @@ -882,7 +882,7 @@ def render_show_backup_base(backup_info, output_fun, header_row, nested_row):
pretty_size(est_dedup_size),
"{percent:.2%}".format(percent=deduplication_ratio),
)
output_fun(nested_row.format("Resource savings", dedupe_output))
output_fun(nested_row.format("Resources saved", dedupe_output))

output_fun(nested_row.format("Timeline", backup_info["timeline"]))
output_fun(nested_row.format("Begin WAL", backup_info["begin_wal"]))
Expand Down Expand Up @@ -1693,9 +1693,9 @@ def result_show_backup(self, backup_ext_info):
if backup_type and backup_type in {"rsync", "incremental"}:
output["base_backup_information"].update(
dict(
resource_savings=pretty_size(data["est_dedup_size"]),
resource_savings_bytes=int(data["est_dedup_size"]),
resource_savings_percentage="{percent:.2%}".format(
resources_saved=pretty_size(data["est_dedup_size"]),
resources_saved_bytes=int(data["est_dedup_size"]),
resources_saved_percentage="{percent:.2%}".format(
percent=data["deduplication_ratio"]
),
)
Expand Down
6 changes: 3 additions & 3 deletions doc/barman.1.d/50-show-backup.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Backup 20240814T017504:
Backup Type : incremental
Backup Size : 22.3 MiB (54.3 MiB with WALs)
WAL Size : 32.0 MiB
Resource savings : 19.5 MiB (86.80%)
Resources saved : 19.5 MiB (86.80%)
Timeline : 1
Begin WAL : 0000000100000CFD000000AD
End WAL : 0000000100000D0D00000008
Expand Down Expand Up @@ -78,8 +78,8 @@ Backup 20240814T017504:
> Below you can find a list of fields that may be shown or omitted depending
> on the type of the backup:
>
> * `Resource savings`: available for "rsync" and "incremental" backups;
> * `Resources saved`: available for "rsync" and "incremental" backups;
> * `Root Backup`, `Parent Backup`, `Backup chain size`: available for
> "incremental" backups only;
> * `Children Backup(s)`: available for "full" and "incremental" backups;
> * `Snapshot information`: available for "snapshot" backups only.
> * `Snapshot information`: available for "snapshot" backups only.
13 changes: 6 additions & 7 deletions tests/test_output.py
Original file line number Diff line number Diff line change
Expand Up @@ -1358,7 +1358,7 @@ def test_result_show_backup_specific_fields_by_backup_type(
writer.close()
(out, err) = capsys.readouterr()

resource_savings_output = "{} ({})".format(
resources_saved_output = "{} ({})".format(
pretty_size(ext_info["est_dedup_size"]),
"{percent:.2%}".format(percent=ext_info["deduplication_ratio"]),
)
Expand All @@ -1367,7 +1367,7 @@ def test_result_show_backup_specific_fields_by_backup_type(
if ext_info["backup_type"] in ("rsync", "incremental"):
assert (
TestConsoleWriter.nested_row.format(
"Resource savings", resource_savings_output
"Resources saved", resources_saved_output
)
in out
)
Expand Down Expand Up @@ -2248,15 +2248,14 @@ def test_result_show_backup(self, capsys):

assert (
pretty_size(ext_info["est_dedup_size"])
== base_information["resource_savings"]
== base_information["resources_saved"]
)
assert ext_info["est_dedup_size"] == base_information["resource_savings_bytes"]
resource_savings_percentage = "{percent:.2%}".format(
assert ext_info["est_dedup_size"] == base_information["resources_saved_bytes"]
resources_saved_percentage = "{percent:.2%}".format(
percent=ext_info["deduplication_ratio"]
)
assert (
resource_savings_percentage
== base_information["resource_savings_percentage"]
resources_saved_percentage == base_information["resources_saved_percentage"]
)

assert ext_info["timeline"] == base_information["timeline"]
Expand Down
Loading