fgerlits commented on code in PR #2081:
URL: https://github.com/apache/nifi-minifi-cpp/pull/2081#discussion_r2661073842
##########
libminifi/test/unit/LogMetricsPublisherTests.cpp:
##########
@@ -86,8 +85,49 @@ TEST_CASE_METHOD(LogPublisherTestFixture, "Verify empty
metrics if no valid metr
}
publisher_->initialize(configuration_, response_node_loader_);
publisher_->loadMetricNodes();
- using
org::apache::nifi::minifi::test::utils::verifyLogLinePresenceInPollTime;
- REQUIRE(verifyLogLinePresenceInPollTime(5s, "LogMetricsPublisher is
configured without any valid metrics!"));
+ REQUIRE(utils::verifyLogLinePresenceInPollTime(5s, "LogMetricsPublisher is
configured without any valid metrics!"));
+}
+
+std::string expectedRepositoryMetricsRegex(std::string level) {
+ std::string regex_pattern =
+ // 1. Log Header & Opening
+ R"(\[[\d\-\s\:\.]+\]\s*\[[^\]]+\]\s*\[)" + std::move(level) +
R"(\]\s*\{\s*)" +
+ R"(\"LogMetrics\":\s*\{\s*)" +
+
+ // 2. (skips other nodes, stops if a \n[ starts (other log line))
+ R"((?:(?!\n\[)[\s\S])*?)" +
+
+ // 3. RepositoryMetrics Node
+ R"(\"RepositoryMetrics\":\s*\{\s*)" +
Review Comment:
Why do we need to escape the `"` characters? This would be marginally less
unreadable without these backslashes.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]