def pretty_print_stats()

in de/cli.py [0:0]


def pretty_print_stats(results):
    # dump the results to the console as a rich formatted table
    console = Console()
    table = Table(show_header=True, header_style="bold magenta")
    table.add_column("Title")
    table.add_column("Total Size", justify="right")
    table.add_column("Chunk Size", justify="right")
    table.add_column("Compressed Chunk Size", justify="right")
    table.add_column("Dedup Ratio", justify="right")
    table.add_column("Compressed Dedup Ratio", justify="right")
    table.add_column("Transmitted XTool Bytes", justify="right")
    for i, row in enumerate(results):
        table.add_row(
            row["title"],
            naturalsize(row["total_len"], binary=True),
            naturalsize(row["chunk_bytes"], binary=True),
            naturalsize(row["compressed_chunk_bytes"], binary=True),
            "{:.0%}".format(row["chunk_bytes"] / results[i]["total_len"]),
            "{:.0%}".format(row["compressed_chunk_bytes"] / results[i]["total_len"]),
            naturalsize(row["transmitted_xtool_bytes"], binary=True)
            if "transmitted_xtool_bytes" in row
            else "",
        )
    console.print(table)