diff options
author | Kaloian Manassiev <kaloian.manassiev@mongodb.com> | 2019-05-16 17:21:29 -0400 |
---|---|---|
committer | Kaloian Manassiev <kaloian.manassiev@mongodb.com> | 2019-05-22 08:38:34 -0400 |
commit | c59329ab6b470a7f61a82b70910b529ae59982ee (patch) | |
tree | 41caf56d8c9b7d47bea721ff95c30087cafb14b3 /src | |
parent | 65656c4bc9390c52205b73451abff0b7b6b74396 (diff) | |
download | mongo-c59329ab6b470a7f61a82b70910b529ae59982ee.tar.gz |
SERVER-41192 Add a logical session cache metric for the size of the SessionCatalog
Diffstat (limited to 'src')
-rw-r--r-- | src/mongo/db/commands/logical_session_server_status_section.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/mongo/db/commands/logical_session_server_status_section.cpp b/src/mongo/db/commands/logical_session_server_status_section.cpp index b23605a5506..d39c8332e6b 100644 --- a/src/mongo/db/commands/logical_session_server_status_section.cpp +++ b/src/mongo/db/commands/logical_session_server_status_section.cpp @@ -33,6 +33,7 @@ #include "mongo/db/jsobj.h" #include "mongo/db/logical_session_cache.h" #include "mongo/db/operation_context.h" +#include "mongo/db/session_catalog.h" namespace mongo { namespace { @@ -48,8 +49,13 @@ public: BSONObj generateSection(OperationContext* opCtx, const BSONElement& configElement) const override { const auto logicalSessionCache = LogicalSessionCache::get(opCtx); + const auto sessionCatalog = SessionCatalog::get(opCtx); - return logicalSessionCache ? logicalSessionCache->getStats().toBSON() : BSONObj(); + BSONObjBuilder statsBuilder(logicalSessionCache ? logicalSessionCache->getStats().toBSON() + : BSONObj()); + statsBuilder.append("sessionCatalogSize", int32_t(sessionCatalog->size())); + + return statsBuilder.obj(); } } logicalSessionsServerStatusSection; |