summaryrefslogtreecommitdiff
path: root/src/mongo/db/ftdc
diff options
context:
space:
mode:
authorMark Benvenuto <mark.benvenuto@mongodb.com>2018-12-18 12:52:13 -0500
committerMark Benvenuto <mark.benvenuto@mongodb.com>2018-12-18 12:52:13 -0500
commitc48fa7e3fe5ad27d7b0e4360da03943b362adf24 (patch)
tree0c006e1a566e602daa588da32b49fa3e912237f4 /src/mongo/db/ftdc
parentbebb6e35482fd706cdfd89fe2c70a925faa47d42 (diff)
downloadmongo-c48fa7e3fe5ad27d7b0e4360da03943b362adf24.tar.gz
SERVER-38565 Convert FTDC options to IDL
Diffstat (limited to 'src/mongo/db/ftdc')
-rw-r--r--src/mongo/db/ftdc/SConscript6
-rw-r--r--src/mongo/db/ftdc/ftdc_mongos.cpp71
-rw-r--r--src/mongo/db/ftdc/ftdc_mongos.h11
-rw-r--r--src/mongo/db/ftdc/ftdc_mongos.idl44
-rw-r--r--src/mongo/db/ftdc/ftdc_server.cpp242
-rw-r--r--src/mongo/db/ftdc/ftdc_server.h37
-rw-r--r--src/mongo/db/ftdc/ftdc_server.idl83
7 files changed, 265 insertions, 229 deletions
diff --git a/src/mongo/db/ftdc/SConscript b/src/mongo/db/ftdc/SConscript
index 6415ae347dd..dd662a24c1c 100644
--- a/src/mongo/db/ftdc/SConscript
+++ b/src/mongo/db/ftdc/SConscript
@@ -45,6 +45,7 @@ env.Library(
target='ftdc_server',
source=[
'ftdc_server.cpp',
+ env.Idlc('ftdc_server.idl')[0],
'ftdc_system_stats.cpp',
'ftdc_system_stats_${TARGET_OS}.cpp',
],
@@ -55,6 +56,9 @@ env.Library(
'$BUILD_DIR/mongo/util/processinfo',
'ftdc'
] + platform_libs,
+ LIBDEPS_PRIVATE=[
+ '$BUILD_DIR/mongo/idl/server_parameter',
+ ],
)
env.Library(
@@ -77,9 +81,11 @@ env.Library(
env.Library(
target='ftdc_mongos',
source=[
+ env.Idlc('ftdc_mongos.idl')[0],
'ftdc_mongos.cpp',
],
LIBDEPS_PRIVATE=[
+ '$BUILD_DIR/mongo/idl/server_parameter',
'ftdc_server'
],
)
diff --git a/src/mongo/db/ftdc/ftdc_mongos.cpp b/src/mongo/db/ftdc/ftdc_mongos.cpp
index 0402178b239..a3c85936268 100644
--- a/src/mongo/db/ftdc/ftdc_mongos.cpp
+++ b/src/mongo/db/ftdc/ftdc_mongos.cpp
@@ -40,6 +40,7 @@
#include "mongo/db/server_parameters.h"
#include "mongo/stdx/thread.h"
#include "mongo/util/log.h"
+#include "mongo/util/synchronized_value.h"
namespace mongo {
@@ -48,68 +49,28 @@ namespace {
/**
* Expose diagnosticDataCollectionDirectoryPath set parameter to specify the MongoS FTDC path.
*/
-class ExportedFTDCDirectoryPathParameter : public ServerParameter {
-public:
- ExportedFTDCDirectoryPathParameter()
- : ServerParameter(ServerParameterSet::getGlobal(),
- "diagnosticDataCollectionDirectoryPath",
- true,
- true) {}
-
-
- void append(OperationContext* opCtx, BSONObjBuilder& b, const std::string& name) final {
- stdx::lock_guard<stdx::mutex> guard(_lock);
- b.append(name, _path.generic_string());
- }
-
- Status set(const BSONElement& newValueElement) {
- if (newValueElement.type() != String) {
- return Status(ErrorCodes::BadValue,
- "diagnosticDataCollectionDirectoryPath only supports type string");
- }
-
- std::string str = newValueElement.str();
- return setFromString(str);
- }
-
- Status setFromString(const std::string& str) final {
- stdx::lock_guard<stdx::mutex> guard(_lock);
-
- FTDCController* controller = nullptr;
+synchronized_value<boost::filesystem::path> ftdcDirectoryPathParameter;
+} // namespace
- if (hasGlobalServiceContext()) {
- controller = FTDCController::get(getGlobalServiceContext());
- }
+void ftdcDirectoryAppendBSON(OperationContext* opCtx, BSONObjBuilder* b, StringData name) {
+ b->append(name, ftdcDirectoryPathParameter->generic_string());
+}
+Status ftdcDirectoryFromString(StringData str) {
+ if (hasGlobalServiceContext()) {
+ FTDCController* controller = FTDCController::get(getGlobalServiceContext());
if (controller) {
- Status s = controller->setDirectory(str);
+ Status s = controller->setDirectory(str.toString());
if (!s.isOK()) {
return s;
}
}
-
- _path = str;
-
- return Status::OK();
}
- boost::filesystem::path getDirectory() {
- stdx::lock_guard<stdx::mutex> guard(_lock);
- return _path;
- }
-
- void setDirectory(boost::filesystem::path& path) {
- stdx::lock_guard<stdx::mutex> guard(_lock);
- _path = path;
- }
+ ftdcDirectoryPathParameter = str.toString();
-private:
- // Lock to guard _path
- stdx::mutex _lock;
-
- // Directory location of ftdc files, guarded by _lock
- boost::filesystem::path _path;
-} exportedFTDCDirectoryPathParameter;
+ return Status::OK();
+}
void registerMongoSCollectors(FTDCController* controller) {
// PoolStats
@@ -117,8 +78,6 @@ void registerMongoSCollectors(FTDCController* controller) {
"connPoolStats", "connPoolStats", "", BSON("connPoolStats" << 1)));
}
-} // namespace
-
void startMongoSFTDC() {
// Get the path to use for FTDC:
// 1. Check if the user set one.
@@ -127,7 +86,7 @@ void startMongoSFTDC() {
// Only attempt to enable FTDC if we have a path to log files to.
FTDCStartMode startMode = FTDCStartMode::kStart;
- auto directory = exportedFTDCDirectoryPathParameter.getDirectory();
+ auto directory = ftdcDirectoryPathParameter.get();
if (directory.empty()) {
if (serverGlobalParams.logpath.empty()) {
@@ -142,7 +101,7 @@ void startMongoSFTDC() {
// 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.
- exportedFTDCDirectoryPathParameter.setDirectory(directory);
+ ftdcDirectoryPathParameter = directory;
}
}
diff --git a/src/mongo/db/ftdc/ftdc_mongos.h b/src/mongo/db/ftdc/ftdc_mongos.h
index 753100cabd7..5bc75c0f179 100644
--- a/src/mongo/db/ftdc/ftdc_mongos.h
+++ b/src/mongo/db/ftdc/ftdc_mongos.h
@@ -30,6 +30,11 @@
#pragma once
+#include "mongo/base/status.h"
+#include "mongo/base/string_data.h"
+#include "mongo/bson/bsonobjbuilder.h"
+#include "mongo/db/operation_context.h"
+
namespace mongo {
/**
@@ -42,4 +47,10 @@ void startMongoSFTDC();
*/
void stopMongoSFTDC();
+/**
+ * Set Parameters utility methods
+ */
+Status ftdcDirectoryFromString(StringData str);
+void ftdcDirectoryAppendBSON(OperationContext* opCtx, BSONObjBuilder* b, StringData name);
+
} // namespace mongo
diff --git a/src/mongo/db/ftdc/ftdc_mongos.idl b/src/mongo/db/ftdc/ftdc_mongos.idl
new file mode 100644
index 00000000000..1a99ab66321
--- /dev/null
+++ b/src/mongo/db/ftdc/ftdc_mongos.idl
@@ -0,0 +1,44 @@
+# Copyright (C) 2018-present MongoDB, Inc.
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the Server Side Public License, version 1,
+# as published by MongoDB, Inc.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# Server Side Public License for more details.
+#
+# You should have received a copy of the Server Side Public License
+# along with this program. If not, see
+# <http://www.mongodb.com/licensing/server-side-public-license>.
+#
+# As a special exception, the copyright holders give permission to link the
+# code of portions of this program with the OpenSSL library under certain
+# conditions as described in each individual source file and distribute
+# linked combinations including the program with the OpenSSL library. You
+# must comply with the Server Side Public License in all respects for
+# all of the code used other than as permitted herein. If you modify file(s)
+# with this exception, you may extend this exception to your version of the
+# file(s), but you are not obligated to do so. If you do not wish to do so,
+# delete this exception statement from your version. If you delete this
+# exception statement from all source files in the program, then also delete
+# it in the license file.
+#
+
+global:
+ cpp_namespace: "mongo"
+ cpp_includes:
+ - "mongo/db/ftdc/ftdc_mongos.h"
+
+imports:
+ - "mongo/idl/basic_types.idl"
+
+server_parameters:
+
+ diagnosticDataCollectionDirectoryPath:
+ description: "Specify the directory for the diagnostic directory for mongos"
+ set_at: [startup, runtime]
+ append_bson: "ftdcDirectoryAppendBSON"
+ from_string: "ftdcDirectoryFromString"
+
diff --git a/src/mongo/db/ftdc/ftdc_server.cpp b/src/mongo/db/ftdc/ftdc_server.cpp
index a46a0106262..3ea6a751aa3 100644
--- a/src/mongo/db/ftdc/ftdc_server.cpp
+++ b/src/mongo/db/ftdc/ftdc_server.cpp
@@ -62,188 +62,81 @@ FTDCController* getGlobalFTDCController() {
return getFTDCController(getGlobalServiceContext()).get();
}
-AtomicBool localEnabledFlag(FTDCConfig::kEnabledDefault);
-
-class ExportedFTDCEnabledParameter
- : public ExportedServerParameter<bool, ServerParameterType::kStartupAndRuntime> {
-public:
- ExportedFTDCEnabledParameter()
- : ExportedServerParameter<bool, ServerParameterType::kStartupAndRuntime>(
- ServerParameterSet::getGlobal(),
- "diagnosticDataCollectionEnabled",
- &localEnabledFlag) {}
-
- virtual Status validate(const bool& potentialNewValue) {
- auto controller = getGlobalFTDCController();
- if (controller) {
- return controller->setEnabled(potentialNewValue);
- }
-
- return Status::OK();
- }
+} // namespace
-} exportedFTDCEnabledParameter;
+FTDCStartupParams ftdcStartupParams;
-AtomicInt32 localPeriodMillis(FTDCConfig::kPeriodMillisDefault);
+Status onUpdateFTDCEnabled(const bool value) {
+ auto controller = getGlobalFTDCController();
+ if (controller) {
+ return controller->setEnabled(value);
+ }
+
+ return Status::OK();
+}
-class ExportedFTDCPeriodParameter
- : public ExportedServerParameter<std::int32_t, ServerParameterType::kStartupAndRuntime> {
-public:
- ExportedFTDCPeriodParameter()
- : ExportedServerParameter<std::int32_t, ServerParameterType::kStartupAndRuntime>(
- ServerParameterSet::getGlobal(),
- "diagnosticDataCollectionPeriodMillis",
- &localPeriodMillis) {}
+Status onUpdateFTDCPeriod(const std::int32_t potentialNewValue) {
+ auto controller = getGlobalFTDCController();
+ if (controller) {
+ controller->setPeriod(Milliseconds(potentialNewValue));
+ }
- virtual Status validate(const std::int32_t& potentialNewValue) {
- if (potentialNewValue < 100) {
- return Status(
- ErrorCodes::BadValue,
- "diagnosticDataCollectionPeriodMillis must be greater than or equal to 100ms");
- }
+ return Status::OK();
+}
- auto controller = getGlobalFTDCController();
- if (controller) {
- controller->setPeriod(Milliseconds(potentialNewValue));
- }
+Status onUpdateFTDCDirectorySize(const std::int32_t potentialNewValue) {
+ if (potentialNewValue < ftdcStartupParams.maxFileSizeMB.load()) {
+ return Status(
+ ErrorCodes::BadValue,
+ str::stream()
+ << "diagnosticDataCollectionDirectorySizeMB must be greater than or equal to '"
+ << ftdcStartupParams.maxFileSizeMB.load()
+ << "' which is the current value of diagnosticDataCollectionFileSizeMB.");
+ }
- return Status::OK();
+ auto controller = getGlobalFTDCController();
+ if (controller) {
+ controller->setMaxDirectorySizeBytes(potentialNewValue * 1024 * 1024);
}
-} exportedFTDCPeriodParameter;
-
-// Scale the values down since are defaults are in bytes, but the user interface is MB
-AtomicInt32 localMaxDirectorySizeMB(FTDCConfig::kMaxDirectorySizeBytesDefault / (1024 * 1024));
-
-AtomicInt32 localMaxFileSizeMB(FTDCConfig::kMaxFileSizeBytesDefault / (1024 * 1024));
-
-class ExportedFTDCDirectorySizeParameter
- : public ExportedServerParameter<std::int32_t, ServerParameterType::kStartupAndRuntime> {
-public:
- ExportedFTDCDirectorySizeParameter()
- : ExportedServerParameter<std::int32_t, ServerParameterType::kStartupAndRuntime>(
- ServerParameterSet::getGlobal(),
- "diagnosticDataCollectionDirectorySizeMB",
- &localMaxDirectorySizeMB) {}
-
- virtual Status validate(const std::int32_t& potentialNewValue) {
- if (potentialNewValue < 10) {
- return Status(
- ErrorCodes::BadValue,
- "diagnosticDataCollectionDirectorySizeMB must be greater than or equal to 10");
- }
-
- if (potentialNewValue < localMaxFileSizeMB.load()) {
- return Status(
- ErrorCodes::BadValue,
- str::stream()
- << "diagnosticDataCollectionDirectorySizeMB must be greater than or equal to '"
- << localMaxFileSizeMB.load()
- << "' which is the current value of diagnosticDataCollectionFileSizeMB.");
- }
-
- auto controller = getGlobalFTDCController();
- if (controller) {
- controller->setMaxDirectorySizeBytes(potentialNewValue * 1024 * 1024);
- }
-
- return Status::OK();
+ return Status::OK();
+}
+
+Status onUpdateFTDCFileSize(const std::int32_t potentialNewValue) {
+ if (potentialNewValue > ftdcStartupParams.maxDirectorySizeMB.load()) {
+ return Status(
+ ErrorCodes::BadValue,
+ str::stream()
+ << "diagnosticDataCollectionFileSizeMB must be less than or equal to '"
+ << ftdcStartupParams.maxDirectorySizeMB.load()
+ << "' which is the current value of diagnosticDataCollectionDirectorySizeMB.");
}
-} exportedFTDCDirectorySizeParameter;
-
-class ExportedFTDCFileSizeParameter
- : public ExportedServerParameter<std::int32_t, ServerParameterType::kStartupAndRuntime> {
-public:
- ExportedFTDCFileSizeParameter()
- : ExportedServerParameter<std::int32_t, ServerParameterType::kStartupAndRuntime>(
- ServerParameterSet::getGlobal(),
- "diagnosticDataCollectionFileSizeMB",
- &localMaxFileSizeMB) {}
-
- virtual Status validate(const std::int32_t& potentialNewValue) {
- if (potentialNewValue < 1) {
- return Status(ErrorCodes::BadValue,
- "diagnosticDataCollectionFileSizeMB must be greater than or equal to 1");
- }
-
- if (potentialNewValue > localMaxDirectorySizeMB.load()) {
- return Status(
- ErrorCodes::BadValue,
- str::stream()
- << "diagnosticDataCollectionFileSizeMB must be less than or equal to '"
- << localMaxDirectorySizeMB.load()
- << "' which is the current value of diagnosticDataCollectionDirectorySizeMB.");
- }
-
- auto controller = getGlobalFTDCController();
- if (controller) {
- controller->setMaxFileSizeBytes(potentialNewValue * 1024 * 1024);
- }
-
- return Status::OK();
+ auto controller = getGlobalFTDCController();
+ if (controller) {
+ controller->setMaxFileSizeBytes(potentialNewValue * 1024 * 1024);
}
-} exportedFTDCFileSizeParameter;
-
-AtomicInt32 localMaxSamplesPerArchiveMetricChunk(
- FTDCConfig::kMaxSamplesPerArchiveMetricChunkDefault);
-
-class ExportedFTDCArchiveChunkSizeParameter
- : public ExportedServerParameter<std::int32_t, ServerParameterType::kStartupAndRuntime> {
-public:
- ExportedFTDCArchiveChunkSizeParameter()
- : ExportedServerParameter<std::int32_t, ServerParameterType::kStartupAndRuntime>(
- ServerParameterSet::getGlobal(),
- "diagnosticDataCollectionSamplesPerChunk",
- &localMaxSamplesPerArchiveMetricChunk) {}
-
- virtual Status validate(const std::int32_t& potentialNewValue) {
- if (potentialNewValue < 2) {
- return Status(
- ErrorCodes::BadValue,
- "diagnosticDataCollectionSamplesPerChunk must be greater than or equal to 2");
- }
-
- auto controller = getGlobalFTDCController();
- if (controller) {
- controller->setMaxSamplesPerArchiveMetricChunk(potentialNewValue);
- }
-
- return Status::OK();
+ return Status::OK();
+}
+
+Status onUpdateFTDCSamplesPerChunk(const std::int32_t potentialNewValue) {
+ auto controller = getGlobalFTDCController();
+ if (controller) {
+ controller->setMaxSamplesPerArchiveMetricChunk(potentialNewValue);
}
-} exportedFTDCArchiveChunkSizeParameter;
-
-AtomicInt32 localMaxSamplesPerInterimMetricChunk(
- FTDCConfig::kMaxSamplesPerInterimMetricChunkDefault);
-
-class ExportedFTDCInterimChunkSizeParameter
- : public ExportedServerParameter<std::int32_t, ServerParameterType::kStartupAndRuntime> {
-public:
- ExportedFTDCInterimChunkSizeParameter()
- : ExportedServerParameter<std::int32_t, ServerParameterType::kStartupAndRuntime>(
- ServerParameterSet::getGlobal(),
- "diagnosticDataCollectionSamplesPerInterimUpdate",
- &localMaxSamplesPerInterimMetricChunk) {}
-
- virtual Status validate(const std::int32_t& potentialNewValue) {
- if (potentialNewValue < 2) {
- return Status(ErrorCodes::BadValue,
- "diagnosticDataCollectionSamplesPerInterimUpdate must be greater than or "
- "equal to 2");
- }
-
- auto controller = getGlobalFTDCController();
- if (controller) {
- controller->setMaxSamplesPerInterimMetricChunk(potentialNewValue);
- }
-
- return Status::OK();
+ return Status::OK();
+}
+
+Status onUpdateFTDCPerInterimUpdate(const std::int32_t potentialNewValue) {
+ auto controller = getGlobalFTDCController();
+ if (controller) {
+ controller->setMaxSamplesPerInterimMetricChunk(potentialNewValue);
}
-} exportedFTDCInterimChunkSizeParameter;
-} // namespace
+ return Status::OK();
+}
FTDCSimpleInternalCommandCollector::FTDCSimpleInternalCommandCollector(StringData command,
StringData name,
@@ -271,15 +164,18 @@ void startFTDC(boost::filesystem::path& path,
FTDCStartMode startupMode,
RegisterCollectorsFunction registerCollectors) {
FTDCConfig config;
- config.period = Milliseconds(localPeriodMillis.load());
+ config.period = Milliseconds(ftdcStartupParams.periodMillis.load());
// Only enable FTDC if our caller says to enable FTDC, MongoS may not have a valid path to write
// files to so update the diagnosticDataCollectionEnabled set parameter to reflect that.
- localEnabledFlag.store(startupMode == FTDCStartMode::kStart && localEnabledFlag.load());
- config.enabled = localEnabledFlag.load();
- config.maxFileSizeBytes = localMaxFileSizeMB.load() * 1024 * 1024;
- config.maxDirectorySizeBytes = localMaxDirectorySizeMB.load() * 1024 * 1024;
- config.maxSamplesPerArchiveMetricChunk = localMaxSamplesPerArchiveMetricChunk.load();
- config.maxSamplesPerInterimMetricChunk = localMaxSamplesPerInterimMetricChunk.load();
+ ftdcStartupParams.enabled.store(startupMode == FTDCStartMode::kStart &&
+ ftdcStartupParams.enabled.load());
+ config.enabled = ftdcStartupParams.enabled.load();
+ config.maxFileSizeBytes = ftdcStartupParams.maxFileSizeMB.load() * 1024 * 1024;
+ config.maxDirectorySizeBytes = ftdcStartupParams.maxDirectorySizeMB.load() * 1024 * 1024;
+ config.maxSamplesPerArchiveMetricChunk =
+ ftdcStartupParams.maxSamplesPerArchiveMetricChunk.load();
+ config.maxSamplesPerInterimMetricChunk =
+ ftdcStartupParams.maxSamplesPerInterimMetricChunk.load();
auto controller = stdx::make_unique<FTDCController>(path, config);
diff --git a/src/mongo/db/ftdc/ftdc_server.h b/src/mongo/db/ftdc/ftdc_server.h
index 81faf0022d8..265c47dfd54 100644
--- a/src/mongo/db/ftdc/ftdc_server.h
+++ b/src/mongo/db/ftdc/ftdc_server.h
@@ -35,6 +35,7 @@
#include "mongo/bson/bsonobjbuilder.h"
#include "mongo/db/commands.h"
#include "mongo/db/ftdc/collector.h"
+#include "mongo/db/ftdc/config.h"
#include "mongo/db/ftdc/controller.h"
#include "mongo/db/jsobj.h"
#include "mongo/db/operation_context.h"
@@ -98,4 +99,40 @@ private:
const OpMsgRequest _request;
};
+/**
+ * FTDC startup parameters.
+ *
+ * Used to provide default values from FTDCConfig to the FTDC set parameters.
+ */
+struct FTDCStartupParams {
+ AtomicBool enabled;
+ AtomicInt32 periodMillis;
+
+ AtomicInt32 maxDirectorySizeMB;
+ AtomicInt32 maxFileSizeMB;
+ AtomicInt32 maxSamplesPerArchiveMetricChunk;
+ AtomicInt32 maxSamplesPerInterimMetricChunk;
+
+ FTDCStartupParams()
+ : enabled(FTDCConfig::kEnabledDefault),
+ periodMillis(FTDCConfig::kPeriodMillisDefault),
+ // Scale the values down since are defaults are in bytes, but the user interface is MB
+ maxDirectorySizeMB(FTDCConfig::kMaxDirectorySizeBytesDefault / (1024 * 1024)),
+ maxFileSizeMB(FTDCConfig::kMaxFileSizeBytesDefault / (1024 * 1024)),
+ maxSamplesPerArchiveMetricChunk(FTDCConfig::kMaxSamplesPerArchiveMetricChunkDefault),
+ maxSamplesPerInterimMetricChunk(FTDCConfig::kMaxSamplesPerInterimMetricChunkDefault) {}
+};
+
+extern FTDCStartupParams ftdcStartupParams;
+
+/**
+ * Server Parameter callbacks
+ */
+Status onUpdateFTDCEnabled(const bool value);
+Status onUpdateFTDCPeriod(const std::int32_t value);
+Status onUpdateFTDCDirectorySize(const std::int32_t value);
+Status onUpdateFTDCFileSize(const std::int32_t value);
+Status onUpdateFTDCSamplesPerChunk(const std::int32_t value);
+Status onUpdateFTDCPerInterimUpdate(const std::int32_t value);
+
} // namespace mongo
diff --git a/src/mongo/db/ftdc/ftdc_server.idl b/src/mongo/db/ftdc/ftdc_server.idl
new file mode 100644
index 00000000000..d1b14d7d613
--- /dev/null
+++ b/src/mongo/db/ftdc/ftdc_server.idl
@@ -0,0 +1,83 @@
+# Copyright (C) 2018-present MongoDB, Inc.
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the Server Side Public License, version 1,
+# as published by MongoDB, Inc.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# Server Side Public License for more details.
+#
+# You should have received a copy of the Server Side Public License
+# along with this program. If not, see
+# <http://www.mongodb.com/licensing/server-side-public-license>.
+#
+# As a special exception, the copyright holders give permission to link the
+# code of portions of this program with the OpenSSL library under certain
+# conditions as described in each individual source file and distribute
+# linked combinations including the program with the OpenSSL library. You
+# must comply with the Server Side Public License in all respects for
+# all of the code used other than as permitted herein. If you modify file(s)
+# with this exception, you may extend this exception to your version of the
+# file(s), but you are not obligated to do so. If you do not wish to do so,
+# delete this exception statement from your version. If you delete this
+# exception statement from all source files in the program, then also delete
+# it in the license file.
+#
+
+global:
+ cpp_namespace: "mongo"
+ cpp_includes:
+ - "mongo/db/ftdc/ftdc_server.h"
+
+imports:
+ - "mongo/idl/basic_types.idl"
+
+server_parameters:
+
+ diagnosticDataCollectionEnabled:
+ description: "Determines whether to enable the collecting and logging of data for diagnostic purposes"
+ set_at: [startup, runtime]
+ cpp_varname: "ftdcStartupParams.enabled"
+ on_update: "onUpdateFTDCEnabled"
+
+ diagnosticDataCollectionPeriodMillis:
+ description: "Specifies the interval, in milliseconds, at which to collect diagnostic data."
+ set_at: [startup, runtime]
+ cpp_varname: "ftdcStartupParams.periodMillis"
+ on_update: "onUpdateFTDCPeriod"
+ validator:
+ gte: 100
+
+ diagnosticDataCollectionDirectorySizeMB:
+ description: "Specifies the maximum size, in megabytes, of the diagnostic.data directory"
+ set_at: [startup, runtime]
+ cpp_varname: "ftdcStartupParams.maxDirectorySizeMB"
+ on_update: "onUpdateFTDCDirectorySize"
+ validator:
+ gte: 10
+
+ diagnosticDataCollectionFileSizeMB:
+ description: Specifies the maximum size, in megabytes, of each diagnostic file"
+ set_at: [startup, runtime]
+ cpp_varname: "ftdcStartupParams.maxFileSizeMB"
+ on_update: "onUpdateFTDCFileSize"
+ validator:
+ gte: 1
+
+ diagnosticDataCollectionSamplesPerChunk:
+ description: "Internal, Specifies the number of samples per diagnostic archive chunk"
+ set_at: [startup, runtime]
+ cpp_varname: "ftdcStartupParams.maxSamplesPerArchiveMetricChunk"
+ on_update: "onUpdateFTDCSamplesPerChunk"
+ validator:
+ gte: 2
+
+ diagnosticDataCollectionSamplesPerInterimUpdate:
+ description: "Internal, Specifies the number of samples per diagnostic interim update"
+ set_at: [startup, runtime]
+ cpp_varname: "ftdcStartupParams.maxSamplesPerInterimMetricChunk"
+ on_update: "onUpdateFTDCPerInterimUpdate"
+ validator:
+ gte: 2