diff options
author | Joel Rosdahl <joel@rosdahl.net> | 2022-12-12 14:33:26 +0100 |
---|---|---|
committer | Joel Rosdahl <joel@rosdahl.net> | 2022-12-13 20:38:38 +0100 |
commit | 5d00143e447a50ef9f4709e685c9f0776431c00b (patch) | |
tree | 2688eb9dc22b1fcdedd7214f9a56959a8a8fb92f | |
parent | d34f8657a16f100bbb196b8f547787d6f5213f1d (diff) | |
download | ccache-5d00143e447a50ef9f4709e685c9f0776431c00b.tar.gz |
fix: Fix conditions for --show-stats
-rw-r--r-- | src/core/Statistics.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/core/Statistics.cpp b/src/core/Statistics.cpp index 662b59ba..98a76231 100644 --- a/src/core/Statistics.cpp +++ b/src/core/Statistics.cpp @@ -314,7 +314,9 @@ Statistics::format_human_readable(const Config& config, const uint64_t remote_errors = S(remote_storage_error); const uint64_t remote_timeouts = S(remote_storage_timeout); - table.add_heading("Local storage:"); + if (!from_log || verbosity > 0 || (local_hits + local_misses) > 0) { + table.add_heading("Local storage:"); + } if (!from_log) { std::vector<C> size_cells{ " Cache size (GB):", @@ -342,7 +344,7 @@ Statistics::format_human_readable(const Config& config, table.add_row({" Cleanups:", cleanups}); } } - if (verbosity > 0 || (remote_hits + remote_misses) > 0) { + if (verbosity > 0 || (local_hits + local_misses) > 0) { add_ratio_row(table, " Hits:", local_hits, local_hits + local_misses); add_ratio_row(table, " Misses:", local_misses, local_hits + local_misses); } |