diff options
author | Allison Easton <allison.easton@mongodb.com> | 2022-07-26 06:39:52 +0000 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2022-07-26 07:17:47 +0000 |
commit | a09694e5cac45dd0150804e2f43a885e105d541b (patch) | |
tree | d0b9476fd3454d0e601066cd83319d7f91e9481d /src/mongo/s | |
parent | 581c2b78935b21bd240732f3a344b157b12bc7dc (diff) | |
download | mongo-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.cpp | 12 |
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 && |