diff options
author | Dan Larkin-York <dan.larkin-york@mongodb.com> | 2022-08-18 18:35:51 +0000 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2022-08-18 20:21:52 +0000 |
commit | 65002ae2d4bacf9413383faa4b38d3480a2a8328 (patch) | |
tree | 01b4e46e18968a9ecaa6037db004761ba69a0f2e /src/mongo/db/catalog/catalog_stats.cpp | |
parent | 44c6926a700486de3c5f2c320f1d92c8c2cdbff9 (diff) | |
download | mongo-65002ae2d4bacf9413383faa4b38d3480a2a8328.tar.gz |
SERVER-67814 Fix detection of and report the number of time-series collections requiring extended range support in serverStatus
Diffstat (limited to 'src/mongo/db/catalog/catalog_stats.cpp')
-rw-r--r-- | src/mongo/db/catalog/catalog_stats.cpp | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/src/mongo/db/catalog/catalog_stats.cpp b/src/mongo/db/catalog/catalog_stats.cpp index 36446c6096a..9b1c0f075a3 100644 --- a/src/mongo/db/catalog/catalog_stats.cpp +++ b/src/mongo/db/catalog/catalog_stats.cpp @@ -28,7 +28,7 @@ */ -#include "mongo/platform/basic.h" +#include "mongo/db/catalog/catalog_stats.h" #include "mongo/db/catalog/collection_catalog.h" #include "mongo/db/catalog/database_holder.h" @@ -38,8 +38,10 @@ #define MONGO_LOGV2_DEFAULT_COMPONENT ::mongo::logv2::LogComponent::kCommand +namespace mongo::catalog_stats { -namespace mongo { +// Number of time-series collections requiring extended range support +AtomicWord<int> requiresTimeseriesExtendedRangeSupport; namespace { class CatalogStatsSSS : public ServerStatusSection { @@ -60,6 +62,7 @@ public: int timeseries = 0; int internalCollections = 0; int internalViews = 0; + int timeseriesExtendedRange = 0; void toBson(BSONObjBuilder* builder) const { builder->append("collections", collections); @@ -69,6 +72,9 @@ public: builder->append("views", views); builder->append("internalCollections", internalCollections); builder->append("internalViews", internalViews); + if (timeseriesExtendedRange > 0) { + builder->append("timeseriesExtendedRange", timeseriesExtendedRange); + } } }; @@ -82,6 +88,7 @@ public: stats.capped = catalogStats.userCapped; stats.clustered = catalogStats.userClustered; stats.internalCollections = catalogStats.internal; + stats.timeseriesExtendedRange = requiresTimeseriesExtendedRangeSupport.load(); const auto viewCatalogDbNames = catalog->getViewCatalogDbNames(opCtx); for (const auto& dbName : viewCatalogDbNames) { @@ -105,4 +112,4 @@ public: } catalogStatsSSS; } // namespace -} // namespace mongo +} // namespace mongo::catalog_stats |