summaryrefslogtreecommitdiff
path: root/src/mongo/db/s/resharding
diff options
context:
space:
mode:
authorBrett Nawrocki <brett.nawrocki@mongodb.com>2022-03-02 17:58:19 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2022-03-04 20:28:20 +0000
commit7212a6838e327a498a56b52f42ddd6ba0f80fce4 (patch)
tree2841ab8861c97b89a9025f4df69483f90ae252b5 /src/mongo/db/s/resharding
parentf3672960cc89c6f7c6cd50cb18cfd8d8d116e43b (diff)
downloadmongo-7212a6838e327a498a56b52f42ddd6ba0f80fce4.tar.gz
SERVER-63728 Differentiate observers by role in cumulative metrics
Differentiate observers by role so that recipient and coordinator estimates can be reported separately. Additionally, split reporting into high/low estimates and replace placeholder values in the ServerStatus report with those estimates.
Diffstat (limited to 'src/mongo/db/s/resharding')
-rw-r--r--src/mongo/db/s/resharding/resharding_metrics_new.cpp4
-rw-r--r--src/mongo/db/s/resharding/resharding_metrics_new_test.cpp2
-rw-r--r--src/mongo/db/s/resharding/resharding_oplog_batch_applier_test.cpp13
-rw-r--r--src/mongo/db/s/resharding/resharding_oplog_crud_application_test.cpp13
4 files changed, 18 insertions, 14 deletions
diff --git a/src/mongo/db/s/resharding/resharding_metrics_new.cpp b/src/mongo/db/s/resharding/resharding_metrics_new.cpp
index e81704c0b3b..9452cb445a6 100644
--- a/src/mongo/db/s/resharding/resharding_metrics_new.cpp
+++ b/src/mongo/db/s/resharding/resharding_metrics_new.cpp
@@ -62,7 +62,9 @@ ReshardingMetricsNew::ReshardingMetricsNew(
cumulativeMetrics) {}
std::string ReshardingMetricsNew::createOperationDescription() const noexcept {
- return fmt::format("ReshardingMetrics{}Service {}", getRoleName(_role), _instanceId.toString());
+ return fmt::format("ReshardingMetrics{}Service {}",
+ ShardingDataTransformMetrics::getRoleName(_role),
+ _instanceId.toString());
}
std::unique_ptr<ReshardingMetricsNew> ReshardingMetricsNew::makeInstance(
diff --git a/src/mongo/db/s/resharding/resharding_metrics_new_test.cpp b/src/mongo/db/s/resharding/resharding_metrics_new_test.cpp
index 0eaaf781594..b2c043a642c 100644
--- a/src/mongo/db/s/resharding/resharding_metrics_new_test.cpp
+++ b/src/mongo/db/s/resharding/resharding_metrics_new_test.cpp
@@ -61,7 +61,7 @@ TEST_F(ReshardingMetricsTest, ReportForCurrentOpShouldHaveGlobalIndexDescription
ASSERT_EQ(report.getStringField("desc").toString(),
fmt::format("ReshardingMetrics{}Service {}",
- ReshardingMetricsNew::getRoleName(role),
+ ShardingDataTransformMetrics::getRoleName(role),
instanceId.toString()));
});
}
diff --git a/src/mongo/db/s/resharding/resharding_oplog_batch_applier_test.cpp b/src/mongo/db/s/resharding/resharding_oplog_batch_applier_test.cpp
index 27d1c2ef4f3..1a54401c910 100644
--- a/src/mongo/db/s/resharding/resharding_oplog_batch_applier_test.cpp
+++ b/src/mongo/db/s/resharding/resharding_oplog_batch_applier_test.cpp
@@ -109,12 +109,13 @@ public:
}
_metrics = std::make_unique<ReshardingMetrics>(serviceContext);
- _metricsNew = ReshardingMetricsNew::makeInstance(UUID::gen(),
- _outputNss,
- ReshardingMetricsNew::kRecipient,
- BSON("y" << 1),
- false,
- serviceContext);
+ _metricsNew =
+ ReshardingMetricsNew::makeInstance(UUID::gen(),
+ _outputNss,
+ ShardingDataTransformMetrics::Role::kRecipient,
+ BSON("y" << 1),
+ false,
+ serviceContext);
_crudApplication = std::make_unique<ReshardingOplogApplicationRules>(
_outputNss,
std::vector<NamespaceString>{_myStashNss, _otherStashNss},
diff --git a/src/mongo/db/s/resharding/resharding_oplog_crud_application_test.cpp b/src/mongo/db/s/resharding/resharding_oplog_crud_application_test.cpp
index 154baba79c8..046b457f876 100644
--- a/src/mongo/db/s/resharding/resharding_oplog_crud_application_test.cpp
+++ b/src/mongo/db/s/resharding/resharding_oplog_crud_application_test.cpp
@@ -111,12 +111,13 @@ public:
}
_metrics = std::make_unique<ReshardingMetrics>(getServiceContext());
- _metricsNew = ReshardingMetricsNew::makeInstance(_sourceUUID,
- _outputNss,
- ReshardingMetricsNew::kRecipient,
- BSON(_newShardKey << 1),
- false,
- serviceContext);
+ _metricsNew =
+ ReshardingMetricsNew::makeInstance(_sourceUUID,
+ _outputNss,
+ ShardingDataTransformMetrics::Role::kRecipient,
+ BSON(_newShardKey << 1),
+ false,
+ serviceContext);
_applier = std::make_unique<ReshardingOplogApplicationRules>(
_outputNss,
std::vector<NamespaceString>{_myStashNss, _otherStashNss},