From 67a388abe3e5de939771bf22f61d0f78b2ca2f63 Mon Sep 17 00:00:00 2001 From: Paul Cristian Sarbu Date: Tue, 10 Jan 2023 16:35:04 +0100 Subject: Just-MR: Add progress reporting for update command Co-authored-by: Sascha Roloff --- src/other_tools/ops_maps/git_update_map.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) (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 c68d6f94..8c98fb09 100644 --- a/src/other_tools/ops_maps/git_update_map.cpp +++ b/src/other_tools/ops_maps/git_update_map.cpp @@ -16,6 +16,8 @@ #include "fmt/core.h" #include "src/buildtool/execution_api/local/config.hpp" +#include "src/other_tools/just_mr/progress_reporting/progress.hpp" +#include "src/other_tools/just_mr/progress_reporting/statistics.hpp" #include "src/other_tools/just_mr/utils.hpp" #include "src/utils/cpp/tmp_dir.hpp" @@ -26,6 +28,10 @@ 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,6 +63,9 @@ auto CreateGitUpdateMap(GitCASPtr const& git_cas, std::size_t jobs) return; } (*setter)(new_commit->c_str()); + // stop progress trace for Git repo + JustMRProgress::Instance().TaskTracker().Stop(id); + JustMRStatistics::Instance().IncrementExecutedCounter(); }; return AsyncMapConsumer(update_commits, jobs); } -- cgit v1.2.3