Skip to content

Commit

Permalink
Add ODS for mononoke dogfooding host
Browse files Browse the repository at this point in the history
Summary: In the previous diff we record dogfooding host in scuba if we have a fetchmiss. This diff add this data to ODS. Then we can check ODS counters for percentage of failure per success on dogfooding hosts, and catch any performance issue in Mononoke before it hit the prod push

Reviewed By: andreacampi

Differential Revision: D64208596

fbshipit-source-id: 578b3e6116abbf5933a7ee8ff873cf503fdc10b6
  • Loading branch information
kavehahmadi60 authored and facebook-github-bot committed Oct 12, 2024
1 parent d0afd96 commit cda17ca
Show file tree
Hide file tree
Showing 2 changed files with 68 additions and 0 deletions.
52 changes: 52 additions & 0 deletions eden/fs/store/hg/SaplingBackingStore.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -470,6 +470,10 @@ void SaplingBackingStore::processBlobImportRequests(
stats_.copy());
break;
}
if (store_.dogfoodingHost()) {
stats_->increment(
&SaplingBackingStoreStats::fetchBlobSuccessDogfooding);
}
} else {
retryRequest.emplace_back(std::move(request));
}
Expand Down Expand Up @@ -517,6 +521,10 @@ void SaplingBackingStore::processBlobImportRequests(
stats_->increment(&SaplingBackingStoreStats::fetchBlobSuccess);
break;
}
if (store_.dogfoodingHost()) {
stats_->increment(
&SaplingBackingStoreStats::fetchBlobSuccessDogfooding);
}
continue;
}

Expand All @@ -528,6 +536,10 @@ void SaplingBackingStore::processBlobImportRequests(
stats_->increment(&SaplingBackingStoreStats::fetchBlobFailure);
break;
}
if (store_.dogfoodingHost()) {
stats_->increment(
&SaplingBackingStoreStats::fetchBlobFailureDogfooding);
}
// The blobs were either not found locally, or, when EdenAPI is enabled,
// not found on the server. Let's retry to import the blob
auto fetchSemiFuture = retryGetBlob(
Expand Down Expand Up @@ -623,6 +635,10 @@ folly::SemiFuture<BlobPtr> SaplingBackingStore::retryGetBlob(
&SaplingBackingStoreStats::fetchBlobRetrySuccess);
break;
}
if (store_.dogfoodingHost()) {
stats_->increment(
&SaplingBackingStoreStats::fetchBlobRetrySuccessDogfooding);
}
switch (fetch_mode) {
case sapling::FetchMode::LocalOnly:
context->setFetchedSource(
Expand Down Expand Up @@ -665,6 +681,10 @@ folly::SemiFuture<BlobPtr> SaplingBackingStore::retryGetBlob(
&SaplingBackingStoreStats::fetchBlobRetryFailure);
break;
}
if (store_.dogfoodingHost()) {
stats_->increment(
&SaplingBackingStoreStats::fetchBlobRetryFailureDogfooding);
}
auto ew = folly::exception_wrapper{blob.exception()};
result = folly::makeFuture<BlobPtr>(std::move(ew));
}
Expand Down Expand Up @@ -776,6 +796,10 @@ void SaplingBackingStore::processTreeImportRequests(
stats_->addDuration(
&SaplingBackingStoreStats::fetchTree, watch.elapsed());
stats_->increment(&SaplingBackingStoreStats::fetchTreeSuccess);
if (store_.dogfoodingHost()) {
stats_->increment(
&SaplingBackingStoreStats::fetchTreeSuccessDogfooding);
}
} else {
retryRequest.emplace_back(std::move(request));
}
Expand Down Expand Up @@ -803,12 +827,20 @@ void SaplingBackingStore::processTreeImportRequests(
stats_->addDuration(
&SaplingBackingStoreStats::fetchTree, watch.elapsed());
stats_->increment(&SaplingBackingStoreStats::fetchTreeSuccess);
if (store_.dogfoodingHost()) {
stats_->increment(
&SaplingBackingStoreStats::fetchTreeSuccessDogfooding);
}
continue;
}

// The trees were either not found locally, or, when EdenAPI is enabled,
// not found on the server. Let's retry to import the trees
stats_->increment(&SaplingBackingStoreStats::fetchTreeFailure);
if (store_.dogfoodingHost()) {
stats_->increment(
&SaplingBackingStoreStats::fetchTreeFailureDogfooding);
}
auto* treeImport =
request->getRequest<SaplingImportRequest::TreeImport>();
auto treeSemiFuture =
Expand Down Expand Up @@ -1547,6 +1579,9 @@ folly::SemiFuture<BackingStore::GetTreeResult> SaplingBackingStore::getTree(
proxyHash.path(),
proxyHash.revHash().toString());
stats_->increment(&SaplingBackingStoreStats::fetchTreeSuccess);
if (store_.dogfoodingHost()) {
stats_->increment(&SaplingBackingStoreStats::fetchTreeSuccessDogfooding);
}
stats_->increment(&SaplingBackingStoreStats::fetchTreeLocal);
return folly::makeSemiFuture(GetTreeResult{
std::move(tree), ObjectFetchContext::Origin::FromDiskCache});
Expand Down Expand Up @@ -1675,6 +1710,9 @@ folly::SemiFuture<BackingStore::GetBlobResult> SaplingBackingStore::getBlob(
auto blob = getBlobLocal(proxyHash);
if (blob.hasValue()) {
stats_->increment(&SaplingBackingStoreStats::fetchBlobSuccess);
if (store_.dogfoodingHost()) {
stats_->increment(&SaplingBackingStoreStats::fetchBlobSuccessDogfooding);
}
stats_->increment(&SaplingBackingStoreStats::fetchBlobLocal);
return folly::makeSemiFuture(GetBlobResult{
std::move(blob.value()), ObjectFetchContext::Origin::FromDiskCache});
Expand Down Expand Up @@ -1992,6 +2030,9 @@ folly::Future<TreePtr> SaplingBackingStore::importTreeManifestImpl(
case ObjectFetchContext::kObjectTypeEnumMax:
break;
}
if (store_.dogfoodingHost()) {
stats_->increment(&SaplingBackingStoreStats::fetchTreeSuccessDogfooding);
}
return folly::makeFuture(std::move(tree.value()));
}
// retry once if the initial fetch failed
Expand All @@ -2015,6 +2056,9 @@ folly::Future<TreePtr> SaplingBackingStore::importTreeManifestImpl(
case ObjectFetchContext::kObjectTypeEnumMax:
break;
}
if (store_.dogfoodingHost()) {
stats_->increment(&SaplingBackingStoreStats::fetchTreeFailureDogfooding);
}
return retryGetTree(manifestNode, objectId, path, context.copy(), type);
}

Expand Down Expand Up @@ -2196,6 +2240,10 @@ folly::Future<TreePtr> SaplingBackingStore::retryGetTreeImpl(
case ObjectFetchContext::kObjectTypeEnumMax:
break;
}
if (store_.dogfoodingHost()) {
stats_->increment(
&SaplingBackingStoreStats::fetchTreeRetrySuccessDogfooding);
}
result = tree.value();
} else {
// Record miss and return error
Expand Down Expand Up @@ -2229,6 +2277,10 @@ folly::Future<TreePtr> SaplingBackingStore::retryGetTreeImpl(
case ObjectFetchContext::kObjectTypeEnumMax:
break;
}
if (store_.dogfoodingHost()) {
stats_->increment(
&SaplingBackingStoreStats::fetchTreeRetryFailureDogfooding);
}
auto ew = folly::exception_wrapper{tree.exception()};
result = folly::makeFuture<TreePtr>(std::move(ew));
}
Expand Down
16 changes: 16 additions & 0 deletions eden/fs/telemetry/EdenStats.h
Original file line number Diff line number Diff line change
Expand Up @@ -504,6 +504,14 @@ struct SaplingBackingStoreStats : StatsGroup<SaplingBackingStoreStats> {
Counter fetchTreeFailure{"store.sapling.fetch_tree_failure"};
Counter fetchTreeRetrySuccess{"store.sapling.fetch_tree_retry_success"};
Counter fetchTreeRetryFailure{"store.sapling.fetch_tree_retry_failure"};
Counter fetchTreeSuccessDogfooding{
"store.sapling.fetch_tree_success_dogfooding"};
Counter fetchTreeFailureDogfooding{
"store.sapling.fetch_tree_failure_dogfooding"};
Counter fetchTreeRetrySuccessDogfooding{
"store.sapling.fetch_tree_retry_success_dogfooding"};
Counter fetchTreeRetryFailureDogfooding{
"store.sapling.fetch_tree_retry_failure_dogfooding"};
Duration getTreeAuxData{"store.sapling.get_tree_metadata_us"};
Duration fetchTreeAuxData{"store.sapling.fetch_tree_metadata_us"};
Counter fetchTreeAuxDataLocal{"store.sapling.fetch_tree_metadata_local"};
Expand Down Expand Up @@ -536,6 +544,14 @@ struct SaplingBackingStoreStats : StatsGroup<SaplingBackingStoreStats> {
Counter fetchBlobFailure{"store.sapling.fetch_blob_failure"};
Counter fetchBlobRetrySuccess{"store.sapling.fetch_blob_retry_success"};
Counter fetchBlobRetryFailure{"store.sapling.fetch_blob_retry_failure"};
Counter fetchBlobSuccessDogfooding{
"store.sapling.fetch_blob_success_dogfooding"};
Counter fetchBlobFailureDogfooding{
"store.sapling.fetch_blob_failure_dogfooding"};
Counter fetchBlobRetrySuccessDogfooding{
"store.sapling.fetch_blob_retry_success_dogfooding"};
Counter fetchBlobRetryFailureDogfooding{
"store.sapling.fetch_blob_retry_failure_dogfooding"};
Duration prefetchBlob{"store.sapling.prefetch_blob_us"};
Counter prefetchBlobLocal{"store.sapling.prefetch_blob_local"};
Counter prefetchBlobRemote{"store.sapling.prefetch_blob_remote"};
Expand Down

0 comments on commit cda17ca

Please sign in to comment.