summaryrefslogtreecommitdiff
path: root/src/mongo/db/free_mon/free_mon_processor.cpp
diff options
context:
space:
mode:
authorMark Benvenuto <mark.benvenuto@mongodb.com>2018-06-18 19:45:08 -0400
committerMark Benvenuto <mark.benvenuto@mongodb.com>2018-06-18 21:44:17 -0400
commit272625228597da9c04aa9843b8128585da16390a (patch)
treec27c36417361d4b4e6176eafe766dbc1af785e9c /src/mongo/db/free_mon/free_mon_processor.cpp
parenta9a9e398d86591c7559ba26580a38c2d439d7835 (diff)
downloadmongo-272625228597da9c04aa9843b8128585da16390a.tar.gz
SERVER-35650 Free Monitoring default interval should be 60 seconds
(cherry picked from commit fc4a3ebf568a3a17cff2a4676a8f4972134747db)
Diffstat (limited to 'src/mongo/db/free_mon/free_mon_processor.cpp')
-rw-r--r--src/mongo/db/free_mon/free_mon_processor.cpp27
1 files changed, 13 insertions, 14 deletions
diff --git a/src/mongo/db/free_mon/free_mon_processor.cpp b/src/mongo/db/free_mon/free_mon_processor.cpp
index c558ee0fb04..e476278e34b 100644
--- a/src/mongo/db/free_mon/free_mon_processor.cpp
+++ b/src/mongo/db/free_mon/free_mon_processor.cpp
@@ -60,10 +60,8 @@ constexpr auto kInformationalURLMaxLength = 4096;
constexpr auto kInformationalMessageMaxLength = 4096;
constexpr auto kUserReminderMaxLength = 4096;
-constexpr Seconds kDefaultMetricsGatherInterval(1);
-
-constexpr auto kReportingIntervalMinutesMin = 1;
-constexpr auto kReportingIntervalMinutesMax = 60 * 60 * 24;
+constexpr auto kReportingIntervalSecondsMin = 1;
+constexpr auto kReportingIntervalSecondsMax = 30 * 60 * 60 * 24;
constexpr auto kMetricsRequestArrayElement = "data"_sd;
@@ -123,14 +121,15 @@ bool MetricsRetryCounter::incrementError() {
FreeMonProcessor::FreeMonProcessor(FreeMonCollectorCollection& registration,
FreeMonCollectorCollection& metrics,
FreeMonNetworkInterface* network,
- bool useCrankForTest)
+ bool useCrankForTest,
+ Seconds metricsGatherInterval)
: _registration(registration),
_metrics(metrics),
_network(network),
_random(Date_t::now().asInt64()),
_registrationRetry(RegistrationRetryCounter(_random)),
_metricsRetry(MetricsRetryCounter(_random)),
- _metricsGatherInterval(kDefaultMetricsGatherInterval),
+ _metricsGatherInterval(metricsGatherInterval),
_queue(useCrankForTest) {
_registrationRetry->reset();
_metricsRetry->reset();
@@ -495,14 +494,14 @@ Status FreeMonProcessor::validateRegistrationResponse(const FreeMonRegistrationR
<< "'");
}
- if (resp.getReportingInterval() < kReportingIntervalMinutesMin ||
- resp.getReportingInterval() > kReportingIntervalMinutesMax) {
+ if (resp.getReportingInterval() < kReportingIntervalSecondsMin ||
+ resp.getReportingInterval() > kReportingIntervalSecondsMax) {
return Status(ErrorCodes::FreeMonHttpPermanentFailure,
str::stream() << "Reporting Interval '" << resp.getReportingInterval()
<< "' must be in the range ["
- << kReportingIntervalMinutesMin
+ << kReportingIntervalSecondsMin
<< ","
- << kReportingIntervalMinutesMax
+ << kReportingIntervalSecondsMax
<< "]");
}
@@ -571,14 +570,14 @@ Status FreeMonProcessor::validateMetricsResponse(const FreeMonMetricsResponse& r
<< "'");
}
- if (resp.getReportingInterval() < kReportingIntervalMinutesMin ||
- resp.getReportingInterval() > kReportingIntervalMinutesMax) {
+ if (resp.getReportingInterval() < kReportingIntervalSecondsMin ||
+ resp.getReportingInterval() > kReportingIntervalSecondsMax) {
return Status(ErrorCodes::FreeMonHttpPermanentFailure,
str::stream() << "Reporting Interval '" << resp.getReportingInterval()
<< "' must be in the range ["
- << kReportingIntervalMinutesMin
+ << kReportingIntervalSecondsMin
<< ","
- << kReportingIntervalMinutesMax
+ << kReportingIntervalSecondsMax
<< "]");
}