summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/other_tools/just_mr/fetch.cpp1
-rw-r--r--src/other_tools/ops_maps/TARGETS3
-rw-r--r--src/other_tools/ops_maps/archive_fetch_map.cpp19
-rw-r--r--src/other_tools/ops_maps/archive_fetch_map.hpp2
4 files changed, 15 insertions, 10 deletions
diff --git a/src/other_tools/just_mr/fetch.cpp b/src/other_tools/just_mr/fetch.cpp
index 2e4346da..11a11306 100644
--- a/src/other_tools/just_mr/fetch.cpp
+++ b/src/other_tools/just_mr/fetch.cpp
@@ -497,6 +497,7 @@ auto MultiRepoFetch(std::shared_ptr<Configuration> const& config,
&(*apis.local),
(fetch_args.backup_to_remote and has_remote_api) ? &*apis.remote
: nullptr,
+ &JustMRStatistics::Instance(),
common_args.jobs);
auto import_to_git_map =
diff --git a/src/other_tools/ops_maps/TARGETS b/src/other_tools/ops_maps/TARGETS
index 798be3e8..bbcee3f8 100644
--- a/src/other_tools/ops_maps/TARGETS
+++ b/src/other_tools/ops_maps/TARGETS
@@ -91,6 +91,7 @@
, "content_cas_map"
, ["src/buildtool/execution_api/common", "common"]
, ["src/buildtool/storage", "storage"]
+ , ["src/other_tools/just_mr/progress_reporting", "statistics"]
]
, "stage": ["src", "other_tools", "ops_maps"]
, "private-deps":
@@ -98,8 +99,6 @@
, ["src/other_tools/just_mr", "utils"]
, ["src/buildtool/file_system", "file_storage"]
, ["src/buildtool/file_system", "file_system_manager"]
- , ["src/other_tools/just_mr/progress_reporting", "statistics"]
- , ["src/other_tools/just_mr/progress_reporting", "progress"]
]
}
, "git_tree_fetch_map":
diff --git a/src/other_tools/ops_maps/archive_fetch_map.cpp b/src/other_tools/ops_maps/archive_fetch_map.cpp
index f04d43f4..17b33092 100644
--- a/src/other_tools/ops_maps/archive_fetch_map.cpp
+++ b/src/other_tools/ops_maps/archive_fetch_map.cpp
@@ -19,8 +19,6 @@
#include "fmt/core.h"
#include "src/buildtool/file_system/file_storage.hpp"
#include "src/buildtool/file_system/file_system_manager.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"
namespace {
@@ -30,6 +28,7 @@ void ProcessContent(std::filesystem::path const& content_path,
gsl::not_null<IExecutionApi const*> const& local_api,
IExecutionApi const* remote_api,
std::string const& content,
+ gsl::not_null<JustMRStatistics*> const& stats,
ArchiveFetchMap::SetterPtr const& setter,
ArchiveFetchMap::LoggerPtr const& logger) {
// try to back up to remote CAS
@@ -60,7 +59,7 @@ void ProcessContent(std::filesystem::path const& content_path,
return;
}
// success
- JustMRStatistics::Instance().IncrementExecutedCounter();
+ stats->IncrementExecutedCounter();
(*setter)(true);
}
@@ -71,16 +70,18 @@ auto CreateArchiveFetchMap(gsl::not_null<ContentCASMap*> const& content_cas_map,
gsl::not_null<Storage const*> const& storage,
gsl::not_null<IExecutionApi const*> const& local_api,
IExecutionApi const* remote_api,
+ gsl::not_null<JustMRStatistics*> const& stats,
std::size_t jobs) -> ArchiveFetchMap {
auto fetch_archive = [content_cas_map,
fetch_dir,
storage,
local_api,
- remote_api](auto ts,
- auto setter,
- auto logger,
- auto /* unused */,
- auto const& key) {
+ remote_api,
+ stats](auto ts,
+ auto setter,
+ auto logger,
+ auto /* unused */,
+ auto const& key) {
// get corresponding distfile
auto distfile =
(key.distfile
@@ -96,6 +97,7 @@ auto CreateArchiveFetchMap(gsl::not_null<ContentCASMap*> const& content_cas_map,
local_api,
remote_api,
content = key.content,
+ stats,
setter,
logger]([[maybe_unused]] auto const& values) {
// content is in local CAS now
@@ -109,6 +111,7 @@ auto CreateArchiveFetchMap(gsl::not_null<ContentCASMap*> const& content_cas_map,
local_api,
remote_api,
content,
+ stats,
setter,
logger);
},
diff --git a/src/other_tools/ops_maps/archive_fetch_map.hpp b/src/other_tools/ops_maps/archive_fetch_map.hpp
index 772d59e4..fccc4bd4 100644
--- a/src/other_tools/ops_maps/archive_fetch_map.hpp
+++ b/src/other_tools/ops_maps/archive_fetch_map.hpp
@@ -22,6 +22,7 @@
#include "gsl/gsl"
#include "src/buildtool/execution_api/common/execution_api.hpp"
#include "src/buildtool/storage/storage.hpp"
+#include "src/other_tools/just_mr/progress_reporting/statistics.hpp"
#include "src/other_tools/ops_maps/content_cas_map.hpp"
/// \brief Maps an archive content hash to a status flag.
@@ -33,6 +34,7 @@ using ArchiveFetchMap = AsyncMapConsumer<ArchiveContent, bool>;
gsl::not_null<Storage const*> const& storage,
gsl::not_null<IExecutionApi const*> const& local_api,
IExecutionApi const* remote_api,
+ gsl::not_null<JustMRStatistics*> const& stats,
std::size_t jobs) -> ArchiveFetchMap;
#endif // INCLUDED_SRC_OTHER_TOOLS_OPS_MAPS_ARCHIVE_FETCH_MAP_HPP