summaryrefslogtreecommitdiff
path: root/src/mongo/s
diff options
context:
space:
mode:
authorAllison Easton <allison.easton@mongodb.com>2022-07-26 06:39:52 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2022-07-26 07:17:47 +0000
commita09694e5cac45dd0150804e2f43a885e105d541b (patch)
treed0b9476fd3454d0e601066cd83319d7f91e9481d /src/mongo/s
parent581c2b78935b21bd240732f3a344b157b12bc7dc (diff)
downloadmongo-a09694e5cac45dd0150804e2f43a885e105d541b.tar.gz
SERVER-67253 Track time spent waiting for refresh on the router
Diffstat (limited to 'src/mongo/s')
-rw-r--r--src/mongo/s/catalog_cache.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/mongo/s/catalog_cache.cpp b/src/mongo/s/catalog_cache.cpp
index 512dd4d2e0b..1600cdaede5 100644
--- a/src/mongo/s/catalog_cache.cpp
+++ b/src/mongo/s/catalog_cache.cpp
@@ -30,6 +30,7 @@
#include "mongo/s/catalog_cache.h"
#include "mongo/bson/bsonobjbuilder.h"
+#include "mongo/db/curop.h"
#include "mongo/db/query/collation/collator_factory_interface.h"
#include "mongo/db/repl/optime_with.h"
#include "mongo/logv2/log.h"
@@ -256,6 +257,11 @@ StatusWith<CachedDatabaseInfo> CatalogCache::getDatabase(OperationContext* opCtx
"SERVER-37398.");
}
+ Timer t{};
+ ScopeGuard finishTiming([&] {
+ CurOp::get(opCtx)->debug().catalogCacheDatabaseLookupMillis += Milliseconds(t.millis());
+ });
+
try {
auto dbEntry = _databaseCache.acquire(opCtx, dbName, CacheCausalConsistency::kLatestKnown);
uassert(ErrorCodes::NamespaceNotFound,
@@ -295,6 +301,12 @@ StatusWith<ChunkManager> CatalogCache::_getCollectionRoutingInfoAt(
return swDbInfo.getStatus();
}
+ Timer curOpTimer{};
+ ScopeGuard finishTiming([&] {
+ CurOp::get(opCtx)->debug().catalogCacheCollectionLookupMillis +=
+ Milliseconds(curOpTimer.millis());
+ });
+
const auto dbInfo = std::move(swDbInfo.getValue());
const auto cacheConsistency = gEnableFinerGrainedCatalogCacheRefresh &&