summaryrefslogtreecommitdiff
path: root/src/mongo/db
diff options
context:
space:
mode:
authorAmirsaman Memaripour <amirsaman.memaripour@mongodb.com>2020-06-01 16:48:20 -0400
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2020-06-03 14:45:51 +0000
commit7423d1ad84b43b2b519d7ec4551eb127ef74764d (patch)
tree25ebe9424dfb205f2f6ecf500d9875c7cdf78e2a /src/mongo/db
parenteab3da634bc745c25c7dd38c07e4911e81020e04 (diff)
downloadmongo-7423d1ad84b43b2b519d7ec4551eb127ef74764d.tar.gz
SERVER-48519 Include mirrored read metrics in ftdc
Diffstat (limited to 'src/mongo/db')
-rw-r--r--src/mongo/db/ftdc/ftdc_server.cpp4
-rw-r--r--src/mongo/db/mirror_maestro.cpp4
-rw-r--r--src/mongo/db/mirror_maestro.h2
3 files changed, 8 insertions, 2 deletions
diff --git a/src/mongo/db/ftdc/ftdc_server.cpp b/src/mongo/db/ftdc/ftdc_server.cpp
index fa215af1dce..f4fcf1e0ec2 100644
--- a/src/mongo/db/ftdc/ftdc_server.cpp
+++ b/src/mongo/db/ftdc/ftdc_server.cpp
@@ -44,6 +44,7 @@
#include "mongo/db/ftdc/ftdc_server_gen.h"
#include "mongo/db/ftdc/ftdc_system_stats.h"
#include "mongo/db/jsobj.h"
+#include "mongo/db/mirror_maestro.h"
#include "mongo/db/service_context.h"
#include "mongo/util/synchronized_value.h"
@@ -207,6 +208,8 @@ public:
// of active migrations.
// "timing" is filtered out because it triggers frequent schema changes.
// "defaultRWConcern" is excluded because it changes rarely and instead included in rotation
+ // "mirroredReads" is included to append the number of mirror-able operations observed and
+ // mirrored by this process in FTDC collections.
BSONObjBuilder commandBuilder;
commandBuilder.append(kCommand, 1);
@@ -214,6 +217,7 @@ public:
commandBuilder.append("sharding", false);
commandBuilder.append("timing", false);
commandBuilder.append("defaultRWConcern", false);
+ commandBuilder.append(MirrorMaestro::kServerStatusSectionName, true);
if (gDiagnosticDataCollectionEnableLatencyHistograms.load()) {
BSONObjBuilder subObjBuilder(commandBuilder.subobjStart("opLatencies"));
diff --git a/src/mongo/db/mirror_maestro.cpp b/src/mongo/db/mirror_maestro.cpp
index 2ff127dea55..f694fc179ab 100644
--- a/src/mongo/db/mirror_maestro.cpp
+++ b/src/mongo/db/mirror_maestro.cpp
@@ -68,7 +68,6 @@ constexpr auto kMirrorMaestroConnPoolMaxSize = 4ull; // Never use more tha
constexpr auto kMirroredReadsParamName = "mirrorReads"_sd;
-constexpr auto kMirroredReadsName = "mirroredReads"_sd;
constexpr auto kMirroredReadsSeenKey = "seen"_sd;
constexpr auto kMirroredReadsSentKey = "sent"_sd;
constexpr auto kMirroredReadsResolvedKey = "resolved"_sd;
@@ -170,7 +169,8 @@ class MirroredReadsSection final : public ServerStatusSection {
public:
using CounterT = long long;
- MirroredReadsSection() : ServerStatusSection(kMirroredReadsName.toString()) {}
+ MirroredReadsSection()
+ : ServerStatusSection(MirrorMaestro::kServerStatusSectionName.toString()) {}
bool includeByDefault() const override {
return false;
diff --git a/src/mongo/db/mirror_maestro.h b/src/mongo/db/mirror_maestro.h
index f595fd0bcc9..8d22586bfdd 100644
--- a/src/mongo/db/mirror_maestro.h
+++ b/src/mongo/db/mirror_maestro.h
@@ -71,6 +71,8 @@ public:
* This function will noop if the MirrorMaestro is currently being initialized or shutdown.
*/
static void tryMirrorRequest(OperationContext* opCtx) noexcept;
+
+ static constexpr auto kServerStatusSectionName = "mirroredReads"_sd;
};
} // namespace mongo