From 7104c7f1dc04187bd23e9499f247d628592e0dd8 Mon Sep 17 00:00:00 2001 From: Klaus Aehlig Date: Fri, 17 Mar 2023 11:40:57 +0100 Subject: just-mr: rework progress reporting and statistics To avoid unnecessary work, just-mr uses on-disk caches, including for the mapping of a distdir to the corresponding git tree. This, however, implies that the number of repositories that are actually considered varies: in order to fetch a distdir repository, all involved archives have to be fetched, but if we have a cache hit none of them is even looked at. So, in order to have a consistent reporting only count top-level targets (i.e., the reachable repositories) in the statistics, not the archives implicitly contained in a distdir, nor low-level sub tasks. The actual fetch acitvity is shown separately by the task tracker. --- src/other_tools/ops_maps/repo_fetch_map.cpp | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) (limited to 'src/other_tools/ops_maps/repo_fetch_map.cpp') diff --git a/src/other_tools/ops_maps/repo_fetch_map.cpp b/src/other_tools/ops_maps/repo_fetch_map.cpp index 1c903fe3..5d58e4b0 100644 --- a/src/other_tools/ops_maps/repo_fetch_map.cpp +++ b/src/other_tools/ops_maps/repo_fetch_map.cpp @@ -39,9 +39,6 @@ auto CreateRepoFetchMap(gsl::not_null const& content_cas_map, auto tree_id_file = JustMR::Utils::GetArchiveTreeIDFile( key.repo_type, key.archive.content); if (not FileSystemManager::Exists(tree_id_file)) { - // start work reporting - JustMRProgress::Instance().TaskTracker().Start(key.archive.origin); - JustMRStatistics::Instance().IncrementQueuedCounter(); // make sure content is in CAS content_cas_map->ConsumeAfterKeysReady( ts, @@ -77,10 +74,8 @@ auto CreateRepoFetchMap(gsl::not_null const& content_cas_map, return; } // success - (*setter)(true); - // report work done - JustMRProgress::Instance().TaskTracker().Stop(origin); JustMRStatistics::Instance().IncrementExecutedCounter(); + (*setter)(true); } else { (*logger)( @@ -123,9 +118,8 @@ auto CreateRepoFetchMap(gsl::not_null const& content_cas_map, return; } // success - (*setter)(true); - // report cache hit JustMRStatistics::Instance().IncrementCacheHitsCounter(); + (*setter)(true); } else { (*logger)(fmt::format("Content {} could not be found in CAS", -- cgit v1.2.3