serverglen commented on code in PR #1854:
URL: https://github.com/apache/incubator-brpc/pull/1854#discussion_r934200122
##########
src/brpc/server.cpp:
##########
@@ -271,7 +271,11 @@ static bvar::Vector<unsigned, 2>
GetSessionLocalDataCount(void* arg) {
}
std::string Server::ServerPrefix() const {
- return butil::string_printf("%s_%d", g_server_info_prefix,
listen_address().port);
+ if(_options.name.empty()) {
+ return butil::string_printf("%s_%d", g_server_info_prefix,
listen_address().port);
+ } else {
+ return std::string(g_server_info_prefix) + "_" + _options.name;
Review Comment:
改成 return _options.name;是不是更好?
我理解既然要自定义server bvar prefix,就最好全部自定义。
--
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]