summaryrefslogtreecommitdiff
path: root/src/other_tools/root_maps/commit_git_map.cpp
diff options
context:
space:
mode:
authorPaul Cristian Sarbu <paul.cristian.sarbu@huawei.com>2023-01-10 15:52:32 +0100
committerSascha Roloff <sascha.roloff@huawei.com>2023-02-27 21:11:41 +0100
commit6d28e7e77bafe30b6a30289d2755ca0bf49636bc (patch)
treeb366ec6cbcf6af66825c14f774aa787cc90a7d89 /src/other_tools/root_maps/commit_git_map.cpp
parent80a82e4e8bd4ff2fba980690e14d416dfa4f79a8 (diff)
downloadjustbuild-6d28e7e77bafe30b6a30289d2755ca0bf49636bc.tar.gz
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 <sascha.roloff@huawei.com>
Diffstat (limited to 'src/other_tools/root_maps/commit_git_map.cpp')
-rw-r--r--src/other_tools/root_maps/commit_git_map.cpp11
1 files changed, 11 insertions, 0 deletions
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 <algorithm>
#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();
}
}