Skip to content

Commit

Permalink
Rename Resources savings into Resource saved
Browse files Browse the repository at this point in the history
Resources saved is a better and clearer name

Signed-off-by: Giulio Calacoci <giulio.calacoci@enterprisedb.com>
  • Loading branch information
gcalacoci committed Aug 22, 2024
1 parent bfaddd4 commit 8415676
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 14 deletions.
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.
14 changes: 7 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,15 @@ 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

0 comments on commit 8415676

Please sign in to comment.