0
0
mirror of https://github.com/mongodb/mongo.git synced 2024-12-01 09:32:32 +01:00

SERVER-47738 Don't include CatalogCache blocked operation metrics on mongod

This commit is contained in:
Blake Oler 2020-04-23 16:38:20 -04:00 committed by Evergreen Agent
parent 3cc55fa1d0
commit 341e556928

View File

@ -47,6 +47,7 @@
#include "mongo/s/client/shard_registry.h"
#include "mongo/s/database_version_helpers.h"
#include "mongo/s/grid.h"
#include "mongo/s/is_mongos.h"
#include "mongo/s/mongos_server_parameters_gen.h"
#include "mongo/s/stale_exception.h"
#include "mongo/util/concurrency/with_lock.h"
@ -582,7 +583,7 @@ void CatalogCache::report(BSONObjBuilder* builder) const {
void CatalogCache::checkAndRecordOperationBlockedByRefresh(OperationContext* opCtx,
mongo::LogicalOp opType) {
if (!operationBlockedBehindCatalogCacheRefresh(opCtx)) {
if (!isMongos() || !operationBlockedBehindCatalogCacheRefresh(opCtx)) {
return;
}
@ -923,23 +924,25 @@ void CatalogCache::Stats::report(BSONObjBuilder* builder) const {
builder->append("countFailedRefreshes", countFailedRefreshes.load());
BSONObjBuilder operationsBlockedByRefreshBuilder(
builder->subobjStart("operationsBlockedByRefresh"));
if (isMongos()) {
BSONObjBuilder operationsBlockedByRefreshBuilder(
builder->subobjStart("operationsBlockedByRefresh"));
operationsBlockedByRefreshBuilder.append("countAllOperations",
operationsBlockedByRefresh.countAllOperations.load());
operationsBlockedByRefreshBuilder.append("countInserts",
operationsBlockedByRefresh.countInserts.load());
operationsBlockedByRefreshBuilder.append("countQueries",
operationsBlockedByRefresh.countQueries.load());
operationsBlockedByRefreshBuilder.append("countUpdates",
operationsBlockedByRefresh.countUpdates.load());
operationsBlockedByRefreshBuilder.append("countDeletes",
operationsBlockedByRefresh.countDeletes.load());
operationsBlockedByRefreshBuilder.append("countCommands",
operationsBlockedByRefresh.countCommands.load());
operationsBlockedByRefreshBuilder.append(
"countAllOperations", operationsBlockedByRefresh.countAllOperations.load());
operationsBlockedByRefreshBuilder.append("countInserts",
operationsBlockedByRefresh.countInserts.load());
operationsBlockedByRefreshBuilder.append("countQueries",
operationsBlockedByRefresh.countQueries.load());
operationsBlockedByRefreshBuilder.append("countUpdates",
operationsBlockedByRefresh.countUpdates.load());
operationsBlockedByRefreshBuilder.append("countDeletes",
operationsBlockedByRefresh.countDeletes.load());
operationsBlockedByRefreshBuilder.append("countCommands",
operationsBlockedByRefresh.countCommands.load());
operationsBlockedByRefreshBuilder.done();
operationsBlockedByRefreshBuilder.done();
}
}
CachedDatabaseInfo::CachedDatabaseInfo(DatabaseType dbt, std::shared_ptr<Shard> primaryShard)