diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/other_tools/just_mr/update.cpp | 2 | ||||
-rw-r--r-- | src/other_tools/ops_maps/TARGETS | 7 | ||||
-rw-r--r-- | src/other_tools/ops_maps/git_update_map.cpp | 26 | ||||
-rw-r--r-- | src/other_tools/ops_maps/git_update_map.hpp | 5 |
4 files changed, 26 insertions, 14 deletions
diff --git a/src/other_tools/just_mr/update.cpp b/src/other_tools/just_mr/update.cpp index 449d8841..9d2c3a0e 100644 --- a/src/other_tools/just_mr/update.cpp +++ b/src/other_tools/just_mr/update.cpp @@ -222,6 +222,8 @@ auto MultiRepoUpdate(std::shared_ptr<Configuration> const& config, common_args.git_path->string(), *common_args.local_launcher, &storage_config, + &JustMRStatistics::Instance(), + &JustMRProgress::Instance(), common_args.jobs); // set up progress observer diff --git a/src/other_tools/ops_maps/TARGETS b/src/other_tools/ops_maps/TARGETS index bbcee3f8..548db656 100644 --- a/src/other_tools/ops_maps/TARGETS +++ b/src/other_tools/ops_maps/TARGETS @@ -39,18 +39,19 @@ , "hdrs": ["git_update_map.hpp"] , "srcs": ["git_update_map.cpp"] , "deps": - [ ["src/other_tools/git_operations", "git_repo_remote"] + [ ["@", "gsl", "", "gsl"] + , ["src/other_tools/git_operations", "git_repo_remote"] , ["src/buildtool/multithreading", "async_map_consumer"] , ["src/utils/cpp", "hash_combine"] , ["src/buildtool/storage", "config"] + , ["src/other_tools/just_mr/progress_reporting", "progress"] + , ["src/other_tools/just_mr/progress_reporting", "statistics"] ] , "stage": ["src", "other_tools", "ops_maps"] , "private-deps": [ ["@", "fmt", "", "fmt"] , ["src/buildtool/execution_api/local", "config"] , ["src/buildtool/storage", "fs_utils"] - , ["src/other_tools/just_mr/progress_reporting", "statistics"] - , ["src/other_tools/just_mr/progress_reporting", "progress"] ] } , "content_cas_map": diff --git a/src/other_tools/ops_maps/git_update_map.cpp b/src/other_tools/ops_maps/git_update_map.cpp index de3bfb25..510b9d1c 100644 --- a/src/other_tools/ops_maps/git_update_map.cpp +++ b/src/other_tools/ops_maps/git_update_map.cpp @@ -17,21 +17,25 @@ #include "fmt/core.h" #include "src/buildtool/execution_api/local/config.hpp" #include "src/buildtool/storage/fs_utils.hpp" -#include "src/other_tools/just_mr/progress_reporting/progress.hpp" -#include "src/other_tools/just_mr/progress_reporting/statistics.hpp" auto CreateGitUpdateMap( GitCASPtr const& git_cas, std::string const& git_bin, std::vector<std::string> const& launcher, gsl::not_null<StorageConfig const*> const& storage_config, + gsl::not_null<JustMRStatistics*> const& stats, + gsl::not_null<JustMRProgress*> const& progress, std::size_t jobs) -> GitUpdateMap { - auto update_commits = [git_cas, git_bin, launcher, storage_config]( - auto /* unused */, - auto setter, - auto logger, - auto /* unused */, - auto const& key) { + auto update_commits = [git_cas, + git_bin, + launcher, + storage_config, + stats, + progress](auto /* unused */, + auto setter, + auto logger, + auto /* unused */, + auto const& key) { // perform git update commit auto git_repo = GitRepoRemote::Open(git_cas); // wrap the tmp odb if (not git_repo) { @@ -50,7 +54,7 @@ auto CreateGitUpdateMap( }); // update commit auto id = fmt::format("{}:{}", key.repo, key.branch); - JustMRProgress::Instance().TaskTracker().Start(id); + progress->TaskTracker().Start(id); auto new_commit = git_repo->UpdateCommitViaTmpRepo(*storage_config, key.repo, key.branch, @@ -58,11 +62,11 @@ auto CreateGitUpdateMap( git_bin, launcher, wrapped_logger); - JustMRProgress::Instance().TaskTracker().Stop(id); + progress->TaskTracker().Stop(id); if (not new_commit) { return; } - JustMRStatistics::Instance().IncrementExecutedCounter(); + stats->IncrementExecutedCounter(); (*setter)(new_commit->c_str()); }; return AsyncMapConsumer<RepoDescriptionForUpdating, std::string>( diff --git a/src/other_tools/ops_maps/git_update_map.hpp b/src/other_tools/ops_maps/git_update_map.hpp index 4b043284..cdb9e55a 100644 --- a/src/other_tools/ops_maps/git_update_map.hpp +++ b/src/other_tools/ops_maps/git_update_map.hpp @@ -20,9 +20,12 @@ #include <utility> #include <vector> +#include "gsl/gsl" #include "src/buildtool/multithreading/async_map_consumer.hpp" #include "src/buildtool/storage/config.hpp" #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/hash_combine.hpp" struct RepoDescriptionForUpdating { @@ -57,6 +60,8 @@ struct hash<RepoDescriptionForUpdating> { std::string const& git_bin, std::vector<std::string> const& launcher, gsl::not_null<StorageConfig const*> const& storage_config, + gsl::not_null<JustMRStatistics*> const& stats, + gsl::not_null<JustMRProgress*> const& progress, std::size_t jobs) -> GitUpdateMap; #endif // INCLUDED_SRC_OTHER_TOOLS_OPS_MAPS_GIT_UPDATE_MAP_HPP |