darion-yaphet commented on code in PR #3643:
URL: https://github.com/apache/brpc/pull/3643#discussion_r4356479594
##########
test/brpc_prometheus_metrics_unittest.cpp:
##########
@@ -49,6 +53,53 @@ class DummyEchoServiceImpl : public test::EchoService {
}
};
+TEST(PrometheusMetrics, method_metrics_remain_exposed_during_startup) {
+ for (int i = 0; i < 20; ++i) {
+ DummyEchoServiceImpl echo_svc;
+ brpc::Server server;
+ ASSERT_EQ(0, server.AddService(&echo_svc,
brpc::SERVER_DOESNT_OWN_SERVICE));
+ brpc::ServerOptions options;
+ options.server_info_name = "prometheus_startup_alias";
+ const std::string count_name =
+ "rpc_server_prometheus_startup_alias_test_echo_service_echo_count";
+ std::atomic<bool> stop(false);
+ std::atomic<bool> observed(false);
+ std::atomic<bool> disappeared(false);
+ bthread::CountdownEvent started;
+ {
+ // Start observing before Start() can publish the first metric.
+ // echo.proto enables idl_support, so both full and short method
+ // names refer to the same MethodStatus.
+ std::thread observer([&] {
+ started.signal();
Review Comment:
This one has already been explained above.
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]