From 6d28e7e77bafe30b6a30289d2755ca0bf49636bc Mon Sep 17 00:00:00 2001 From: Paul Cristian Sarbu Date: Tue, 10 Jan 2023 15:52:32 +0100 Subject: Just-MR: Add progress reporting for setup command This includes also the setup-env command, as well as all ~just~ known subcommands that require a just-mr setup step. Co-authored-by: Sascha Roloff --- src/other_tools/root_maps/commit_git_map.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src/other_tools/root_maps/commit_git_map.cpp') diff --git a/src/other_tools/root_maps/commit_git_map.cpp b/src/other_tools/root_maps/commit_git_map.cpp index 5d34182b..18adc4fa 100644 --- a/src/other_tools/root_maps/commit_git_map.cpp +++ b/src/other_tools/root_maps/commit_git_map.cpp @@ -17,6 +17,8 @@ #include #include "src/other_tools/git_operations/git_repo_remote.hpp" +#include "src/other_tools/just_mr/progress_reporting/progress.hpp" +#include "src/other_tools/just_mr/progress_reporting/statistics.hpp" #include "src/utils/cpp/tmp_dir.hpp" namespace { @@ -179,6 +181,10 @@ void EnsureCommit(GitRepoInfo const& repo_info, "Keep referenced tree alive" // message }, GitOpType::KEEP_TAG}; + // start work reporting + JustMRProgress::Instance().TaskTracker().Start(repo_info.origin); + JustMRStatistics::Instance().IncrementQueuedCounter(); + // do the fetch critical_git_op_map->ConsumeAfterKeysReady( ts, {std::move(op_key)}, @@ -217,6 +223,9 @@ void EnsureCommit(GitRepoInfo const& repo_info, // set the workspace root (*ws_setter)( nlohmann::json::array({"git tree", *subtree, repo_root})); + // report work done + JustMRProgress::Instance().TaskTracker().Stop(repo_info.origin); + JustMRStatistics::Instance().IncrementExecutedCounter(); }, [logger, target_path = repo_root](auto const& msg, bool fatal) { (*logger)(fmt::format("While running critical Git op " @@ -242,5 +251,7 @@ void EnsureCommit(GitRepoInfo const& repo_info, } // set the workspace root (*ws_setter)(nlohmann::json::array({"git tree", *subtree, repo_root})); + // report cache hit + JustMRStatistics::Instance().IncrementCacheHitsCounter(); } } -- cgit v1.2.3