diff options
author | Mark Benvenuto <mark.benvenuto@mongodb.com> | 2019-01-24 11:09:27 -0500 |
---|---|---|
committer | Mark Benvenuto <mark.benvenuto@mongodb.com> | 2019-01-24 11:09:27 -0500 |
commit | 731bc64f8dbbee1def448b10feca305887bdc180 (patch) | |
tree | 50663e4c2a349feea8462e60e8501fbbcc89f981 /src/mongo/db/ftdc/ftdc_mongos.cpp | |
parent | 3c5bb991e11d25fb767ee5c6fb249c3bcafa32a3 (diff) | |
download | mongo-731bc64f8dbbee1def448b10feca305887bdc180.tar.gz |
SERVER-38464 Add setParameter for custom FTDC data directory
Diffstat (limited to 'src/mongo/db/ftdc/ftdc_mongos.cpp')
-rw-r--r-- | src/mongo/db/ftdc/ftdc_mongos.cpp | 35 |
1 files changed, 1 insertions, 34 deletions
diff --git a/src/mongo/db/ftdc/ftdc_mongos.cpp b/src/mongo/db/ftdc/ftdc_mongos.cpp index 15a8f28f1d5..604f195d52b 100644 --- a/src/mongo/db/ftdc/ftdc_mongos.cpp +++ b/src/mongo/db/ftdc/ftdc_mongos.cpp @@ -36,7 +36,6 @@ #include <boost/filesystem.hpp> #include "mongo/db/ftdc/controller.h" -#include "mongo/db/ftdc/ftdc_mongos_gen.h" #include "mongo/db/ftdc/ftdc_server.h" #include "mongo/db/server_parameters.h" #include "mongo/stdx/thread.h" @@ -45,36 +44,6 @@ namespace mongo { -namespace { - -/** - * Expose diagnosticDataCollectionDirectoryPath set parameter to specify the MongoS FTDC path. - */ -synchronized_value<boost::filesystem::path> ftdcDirectoryPathParameter; -} // namespace - -void DiagnosticDataCollectionDirectoryPathServerParameter::append(OperationContext* opCtx, - BSONObjBuilder& b, - const std::string& name) { - b.append(name, ftdcDirectoryPathParameter->generic_string()); -} - -Status DiagnosticDataCollectionDirectoryPathServerParameter::setFromString(const std::string& str) { - if (hasGlobalServiceContext()) { - FTDCController* controller = FTDCController::get(getGlobalServiceContext()); - if (controller) { - Status s = controller->setDirectory(str); - if (!s.isOK()) { - return s; - } - } - } - - ftdcDirectoryPathParameter = str; - - return Status::OK(); -} - void registerMongoSCollectors(FTDCController* controller) { // PoolStats controller->addPeriodicCollector(stdx::make_unique<FTDCSimpleInternalCommandCollector>( @@ -89,7 +58,7 @@ void startMongoSFTDC() { // Only attempt to enable FTDC if we have a path to log files to. FTDCStartMode startMode = FTDCStartMode::kStart; - auto directory = ftdcDirectoryPathParameter.get(); + auto directory = getFTDCDirectoryPathParameter(); if (directory.empty()) { if (serverGlobalParams.logpath.empty()) { @@ -100,11 +69,9 @@ void startMongoSFTDC() { directory = boost::filesystem::absolute( FTDCUtil::getMongoSPath(serverGlobalParams.logpath), serverGlobalParams.cwd); - // Update the server parameter with the computed path. // Note: If the computed FTDC directory conflicts with an existing file, then FTDC will // warn about the conflict, and not startup. It will not terminate MongoS in this // situation. - ftdcDirectoryPathParameter = directory; } } |