Commit 16b9bc78 authored by zhujiashun's avatar zhujiashun

Make ServerPrivateAccessor::Prefix static

parent 81c8e7f2
......@@ -190,7 +190,7 @@ void PrometheusMetricsService::default_method(::google::protobuf::RpcController*
int DumpPrometheusMetricsToIOBuf(butil::IOBuf* output) {
butil::IOBufBuilder os;
PrometheusMetricsDumper dumper(&os, brpc::ServerPrivateAccessor(NULL).Prefix());
PrometheusMetricsDumper dumper(&os, brpc::ServerPrivateAccessor::Prefix());
const int ndump = bvar::Variable::dump_exposed(&dumper, NULL);
if (ndump < 0) {
return -1;
......
......@@ -30,6 +30,7 @@ namespace brpc {
class ServerPrivateAccessor {
public:
explicit ServerPrivateAccessor(const Server* svr) {
CHECK(svr);
_server = svr;
}
......@@ -97,7 +98,7 @@ public:
RestfulMap* global_restful_map() const
{ return _server->_global_restful_map; }
std::string Prefix() const { return Server::Prefix(); }
static std::string Prefix() { return Server::Prefix(); }
private:
const Server* _server;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment