summaryrefslogtreecommitdiff
path: root/src/other_tools/root_maps/content_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/content_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/content_git_map.cpp')
-rw-r--r--src/other_tools/root_maps/content_git_map.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/other_tools/root_maps/content_git_map.cpp b/src/other_tools/root_maps/content_git_map.cpp
index 11adf136..584fabc7 100644
--- a/src/other_tools/root_maps/content_git_map.cpp
+++ b/src/other_tools/root_maps/content_git_map.cpp
@@ -16,6 +16,8 @@
#include "src/buildtool/execution_api/local/local_cas.hpp"
#include "src/buildtool/file_system/file_storage.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/utils/archive_ops.hpp"
namespace {
@@ -116,6 +118,8 @@ auto CreateContentGitMap(
{"git tree",
*subtree_hash,
JustMR::Utils::GetGitCacheRoot().string()}));
+ // report cache hit
+ JustMRStatistics::Instance().IncrementCacheHitsCounter();
},
[logger, target_path = JustMR::Utils::GetGitCacheRoot()](
auto const& msg, bool fatal) {
@@ -128,6 +132,9 @@ auto CreateContentGitMap(
});
}
else {
+ // start work reporting;
+ JustMRProgress::Instance().TaskTracker().Start(key.archive.origin);
+ JustMRStatistics::Instance().IncrementQueuedCounter();
// do the fetch and import_to_git
content_cas_map->ConsumeAfterKeysReady(
ts,
@@ -136,6 +143,7 @@ auto CreateContentGitMap(
repo_type = key.repo_type,
content_id = key.archive.content,
subdir = key.subdir,
+ origin = key.archive.origin,
import_to_git_map,
ts,
setter,
@@ -175,6 +183,7 @@ auto CreateContentGitMap(
[tmp_dir, // keep tmp_dir alive
archive_tree_id_file,
subdir,
+ origin,
setter,
logger](auto const& values) {
// check for errors
@@ -236,6 +245,11 @@ auto CreateContentGitMap(
{"git tree",
*subtree_hash,
JustMR::Utils::GetGitCacheRoot().string()}));
+ // report work done
+ JustMRProgress::Instance().TaskTracker().Stop(
+ origin);
+ JustMRStatistics::Instance()
+ .IncrementExecutedCounter();
},
[logger, target_path = tmp_dir->GetPath()](
auto const& msg, bool fatal) {