From 7104c7f1dc04187bd23e9499f247d628592e0dd8 Mon Sep 17 00:00:00 2001 From: Klaus Aehlig Date: Fri, 17 Mar 2023 11:40:57 +0100 Subject: 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. --- src/other_tools/ops_maps/git_update_map.cpp | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'src/other_tools/ops_maps/git_update_map.cpp') diff --git a/src/other_tools/ops_maps/git_update_map.cpp b/src/other_tools/ops_maps/git_update_map.cpp index 8c98fb09..c4305e69 100644 --- a/src/other_tools/ops_maps/git_update_map.cpp +++ b/src/other_tools/ops_maps/git_update_map.cpp @@ -28,10 +28,6 @@ auto CreateGitUpdateMap(GitCASPtr const& git_cas, std::size_t jobs) auto logger, auto /* unused */, auto const& key) { - // start progress trace for Git repo - auto id = fmt::format("{}:{}", key.first, key.second); - JustMRProgress::Instance().TaskTracker().Start(id); - JustMRStatistics::Instance().IncrementQueuedCounter(); // perform git update commit auto git_repo = GitRepoRemote::Open(git_cas); // wrap the tmp odb if (not git_repo) { @@ -57,15 +53,16 @@ auto CreateGitUpdateMap(GitCASPtr const& git_cas, std::size_t jobs) fatal); }); // update commit + auto id = fmt::format("{}:{}", key.first, key.second); + JustMRProgress::Instance().TaskTracker().Start(id); auto new_commit = git_repo->UpdateCommitViaTmpRepo( tmp_dir->GetPath(), key.first, key.second, wrapped_logger); + JustMRProgress::Instance().TaskTracker().Stop(id); if (not new_commit) { return; } - (*setter)(new_commit->c_str()); - // stop progress trace for Git repo - JustMRProgress::Instance().TaskTracker().Stop(id); JustMRStatistics::Instance().IncrementExecutedCounter(); + (*setter)(new_commit->c_str()); }; return AsyncMapConsumer(update_commits, jobs); } -- cgit v1.2.3