From 02e31adfd4cc1f87a08b98eb159d56bb4cb60f1e Mon Sep 17 00:00:00 2001 From: Liubov Dmitrieva Date: Mon, 18 Mar 2024 03:32:24 -0700 Subject: [PATCH] separate perf counters for fetching manifest content and AUX data Summary: separate perf counters for fetching manifest content and trees AUX data the trees request contain request's attributes where we specify what we would need to fetch: the attribites contain 3 optional fields: manifest_blob parents child_metadata So, it is possible to fetch only the manifest blob, only the AUX data or fetch both. For Mononoke, it is the most logical to separate Perf Counters, so that we can have more insight in nature of requests. This diff doesn't introduce new one for parents, only for AUX data. Reviewed By: markbt Differential Revision: D54949001 fbshipit-source-id: 5c874241f50882d1a6cc77feaca3bcd0746b8ad2 --- eden/mononoke/edenapi_service/src/handlers/trees.rs | 11 ++++++++--- eden/mononoke/server/context/src/perf_counters.rs | 2 ++ 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/eden/mononoke/edenapi_service/src/handlers/trees.rs b/eden/mononoke/edenapi_service/src/handlers/trees.rs index 3fe0e8e086e30..a038ffc9664a5 100644 --- a/eden/mononoke/edenapi_service/src/handlers/trees.rs +++ b/eden/mononoke/edenapi_service/src/handlers/trees.rs @@ -88,9 +88,6 @@ pub async fn trees(state: &mut State) -> Result if let Some(rd) = RequestDumper::try_borrow_mut_from(state) { rd.add_request(&request); }; - repo.ctx() - .perf_counters() - .add_to_counter(PerfCounterType::EdenapiTrees, request.keys.len() as i64); ScubaMiddlewareState::try_set_sampling_rate(state, nonzero_ext::nonzero!(256_u64)); @@ -137,6 +134,10 @@ async fn fetch_tree( .with_context(|| ErrorKind::KeyDoesNotExist(key.clone()))?; if attributes.manifest_blob { + repo.ctx() + .perf_counters() + .increment_counter(PerfCounterType::EdenapiTrees); + let (data, _) = ctx .content() .await @@ -150,6 +151,10 @@ async fn fetch_tree( } if attributes.child_metadata { + repo.ctx() + .perf_counters() + .increment_counter(PerfCounterType::EdenapiTreesAuxData); + if let Some(entries) = fetch_child_metadata_entries(&repo, &ctx).await? { let children: Vec> = entries .buffer_unordered(MAX_CONCURRENT_METADATA_FETCHES_PER_TREE_FETCH) diff --git a/eden/mononoke/server/context/src/perf_counters.rs b/eden/mononoke/server/context/src/perf_counters.rs index e640ef3e1fa60..5928c406c070e 100644 --- a/eden/mononoke/server/context/src/perf_counters.rs +++ b/eden/mononoke/server/context/src/perf_counters.rs @@ -76,6 +76,7 @@ define_perf_counters! { EdenapiFiles, EdenapiFilesAuxData, EdenapiTrees, + EdenapiTreesAuxData, GetbundleFilenodesTotalWeight, GetbundleNumCommits, GetbundleNumDrafts, @@ -180,6 +181,7 @@ impl PerfCounterType { | EdenapiFiles | EdenapiFilesAuxData | EdenapiTrees + | EdenapiTreesAuxData | GetbundleFilenodesTotalWeight | GetbundleNumCommits | GetbundleNumDrafts