]> git.ipfire.org Git - thirdparty/ccache.git/commit
feat: Improve statistics for remote hits/misses
authorJoel Rosdahl <joel@rosdahl.net>
Mon, 3 Oct 2022 18:18:03 +0000 (20:18 +0200)
committerJoel Rosdahl <joel@rosdahl.net>
Tue, 4 Oct 2022 14:44:16 +0000 (16:44 +0200)
commit2ea3416d9b94663fcdab3063565ad7b9d29716c2
tree0486d06cba682f5df863293a5cfa8c4be35e1f89
parent908ea60a0e6c5523c8639149784567868eabaef6
feat: Improve statistics for remote hits/misses

ccache collects statistics about local and remote storage layer get/put
operations and describes them as "local/remote hits/misses" in the
output of "ccache -s". However, since "hits" and "misses" mean "result
hit/miss" in the "cacheable calls" section, it's easy to think that they
measure the same thing.

This commit improves the situation by:

- Adding new "local/remote hits/misses" counters that mean "result
  hit/miss". These are shown if remote storage is used (since they
  otherwise are redundant and equal to the normal "hits/misses"
  counters) or if the -v/--verbose option is given.
- Presenting the previous "local/remote hits/misses" counters as
  "local/remote reads". Only shown in verbose mode.
- Adding "local/remote writes" counters. Only shown in verbose mode.

Closes #1016.
src/core/Statistic.hpp
src/core/Statistics.cpp
src/storage/Storage.cpp
src/storage/Storage.hpp
src/storage/local/LocalStorage.cpp
src/storage/local/LocalStorage.hpp
test/suites/base.bash
test/suites/direct.bash
test/suites/remote_file.bash
test/suites/remote_only.bash
test/suites/stats_log.bash