summaryrefslogtreecommitdiff
path: root/src/mongo/db/ftdc/ftdc_server.h
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/ftdc_server.h
parentbebb6e35482fd706cdfd89fe2c70a925faa47d42 (diff)
downloadmongo-c48fa7e3fe5ad27d7b0e4360da03943b362adf24.tar.gz
SERVER-38565 Convert FTDC options to IDL
Diffstat (limited to 'src/mongo/db/ftdc/ftdc_server.h')
-rw-r--r--src/mongo/db/ftdc/ftdc_server.h37
1 files changed, 37 insertions, 0 deletions
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