diff options
Diffstat (limited to 'src/mongo/db/catalog/health_log.cpp')
-rw-r--r-- | src/mongo/db/catalog/health_log.cpp | 23 |
1 files changed, 5 insertions, 18 deletions
diff --git a/src/mongo/db/catalog/health_log.cpp b/src/mongo/db/catalog/health_log.cpp index 46f14a5d662..9626d456111 100644 --- a/src/mongo/db/catalog/health_log.cpp +++ b/src/mongo/db/catalog/health_log.cpp @@ -27,18 +27,14 @@ * it in the license file. */ -#include "mongo/platform/basic.h" - #include "mongo/db/catalog/health_log.h" #include "mongo/db/catalog/health_log_gen.h" #include "mongo/db/db_raii.h" +#include "mongo/db/namespace_string.h" namespace mongo { namespace { -const ServiceContext::Decoration<HealthLog> getHealthLog = - ServiceContext::declareDecoration<HealthLog>(); - const int64_t kDefaultHealthlogSize = 100'000'000; CollectionOptions getOptions(void) { @@ -50,24 +46,17 @@ CollectionOptions getOptions(void) { } } // namespace -HealthLog::HealthLog() : _writer(nss, getOptions(), kMaxBufferSize) {} +HealthLog::HealthLog() + : _writer(NamespaceString::kLocalHealthLogNamespace, getOptions(), kMaxBufferSize) {} -void HealthLog::startup(void) { +void HealthLog::startup() { _writer.startup(std::string("healthlog writer")); } -void HealthLog::shutdown(void) { +void HealthLog::shutdown() { _writer.shutdown(); } -HealthLog& HealthLog::get(ServiceContext* svcCtx) { - return getHealthLog(svcCtx); -} - -HealthLog& HealthLog::get(OperationContext* opCtx) { - return getHealthLog(opCtx->getServiceContext()); -} - bool HealthLog::log(const HealthLogEntry& entry) { BSONObjBuilder builder; OID oid; @@ -76,6 +65,4 @@ bool HealthLog::log(const HealthLogEntry& entry) { entry.serialize(&builder); return _writer.insertDocument(builder.obj()); } - -const NamespaceString HealthLog::nss("local", "system.healthlog"); } // namespace mongo |