diff options
author | Klaus Aehlig <klaus.aehlig@huawei.com> | 2023-03-17 11:40:57 +0100 |
---|---|---|
committer | Klaus Aehlig <klaus.aehlig@huawei.com> | 2023-03-20 11:10:05 +0100 |
commit | 7104c7f1dc04187bd23e9499f247d628592e0dd8 (patch) | |
tree | c719775c5f3fb5e1219c333979fda7ed994e8294 /src/other_tools/root_maps/distdir_git_map.hpp | |
parent | fe99ba0bb02ca2032a464ae0eddc41e0e9ebdb2c (diff) | |
download | justbuild-7104c7f1dc04187bd23e9499f247d628592e0dd8.tar.gz |
just-mr: rework progress reporting and statistics
To avoid unnecessary work, just-mr uses on-disk caches, including
for the mapping of a distdir to the corresponding git tree. This,
however, implies that the number of repositories that are actually
considered varies: in order to fetch a distdir repository, all
involved archives have to be fetched, but if we have a cache hit
none of them is even looked at.
So, in order to have a consistent reporting only count top-level
targets (i.e., the reachable repositories) in the statistics,
not the archives implicitly contained in a distdir, nor low-level
sub tasks. The actual fetch acitvity is shown separately by the
task tracker.
Diffstat (limited to 'src/other_tools/root_maps/distdir_git_map.hpp')
-rw-r--r-- | src/other_tools/root_maps/distdir_git_map.hpp | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/other_tools/root_maps/distdir_git_map.hpp b/src/other_tools/root_maps/distdir_git_map.hpp index 8f7796e3..c440253b 100644 --- a/src/other_tools/root_maps/distdir_git_map.hpp +++ b/src/other_tools/root_maps/distdir_git_map.hpp @@ -15,6 +15,8 @@ #ifndef INCLUDED_SRC_OTHER_TOOLS_ROOT_MAPS_DISTDIR_GIT_MAP_HPP #define INCLUDED_SRC_OTHER_TOOLS_ROOT_MAPS_DISTDIR_GIT_MAP_HPP +#include <utility> + #include "nlohmann/json.hpp" #include "src/other_tools/ops_maps/content_cas_map.hpp" #include "src/other_tools/ops_maps/import_to_git_map.hpp" @@ -33,8 +35,10 @@ struct DistdirInfo { }; /// \brief Maps a list of repositories belonging to a distdir to its -/// corresponding workspace root. -using DistdirGitMap = AsyncMapConsumer<DistdirInfo, nlohmann::json>; +/// corresponding workspace root and indication whether this was a cache +/// hit. +using DistdirGitMap = + AsyncMapConsumer<DistdirInfo, std::pair<nlohmann::json, bool>>; [[nodiscard]] auto CreateDistdirGitMap( gsl::not_null<ContentCASMap*> const& content_cas_map, @@ -52,4 +56,4 @@ struct hash<DistdirInfo> { }; } // namespace std -#endif // INCLUDED_SRC_OTHER_TOOLS_ROOT_MAPS_DISTDIR_GIT_MAP_HPP
\ No newline at end of file +#endif // INCLUDED_SRC_OTHER_TOOLS_ROOT_MAPS_DISTDIR_GIT_MAP_HPP |