Skip to content

Commit

Permalink
separate perf counters for fetching manifest content and AUX data
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Liubov Dmitrieva authored and facebook-github-bot committed Mar 18, 2024
1 parent 8da8ef7 commit 02e31ad
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
11 changes: 8 additions & 3 deletions eden/mononoke/edenapi_service/src/handlers/trees.rs
Original file line number Diff line number Diff line change
Expand Up @@ -88,9 +88,6 @@ pub async fn trees(state: &mut State) -> Result<impl TryIntoResponse, HttpError>
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));

Expand Down Expand Up @@ -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
Expand All @@ -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<Result<TreeChildEntry, EdenApiServerError>> = entries
.buffer_unordered(MAX_CONCURRENT_METADATA_FETCHES_PER_TREE_FETCH)
Expand Down
2 changes: 2 additions & 0 deletions eden/mononoke/server/context/src/perf_counters.rs
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ define_perf_counters! {
EdenapiFiles,
EdenapiFilesAuxData,
EdenapiTrees,
EdenapiTreesAuxData,
GetbundleFilenodesTotalWeight,
GetbundleNumCommits,
GetbundleNumDrafts,
Expand Down Expand Up @@ -180,6 +181,7 @@ impl PerfCounterType {
| EdenapiFiles
| EdenapiFilesAuxData
| EdenapiTrees
| EdenapiTreesAuxData
| GetbundleFilenodesTotalWeight
| GetbundleNumCommits
| GetbundleNumDrafts
Expand Down

0 comments on commit 02e31ad

Please sign in to comment.