MCPcopy Create free account
hub / github.com/apache/brpc / stats

Method stats

src/brpc/builtin/rpcz_service.cpp:139–157  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

137}
138
139void RpczService::stats(::google::protobuf::RpcController* cntl_base,
140 const ::brpc::RpczRequest*,
141 ::brpc::RpczResponse*,
142 ::google::protobuf::Closure* done) {
143 ClosureGuard done_guard(done);
144 Controller *cntl = static_cast<Controller*>(cntl_base);
145 cntl->http_response().set_content_type("text/plain");
146
147 if (!FLAGS_enable_rpcz && !has_span_db()) {
148 cntl->response_attachment().append(
149 "rpcz is not enabled yet. You can turn on/off rpcz by accessing "
150 "/rpcz/enable and /rpcz/disable respectively");
151 return;
152 }
153
154 butil::IOBufBuilder os;
155 DescribeSpanDB(os);
156 os.move_to(cntl->response_attachment());
157}
158
159inline void PrintRealTime(std::ostream& os, int64_t tm) {
160 char buf[16];

Callers 1

TestRpczMethod · 0.80

Calls 5

has_span_dbFunction · 0.85
DescribeSpanDBFunction · 0.85
set_content_typeMethod · 0.80
appendMethod · 0.45
move_toMethod · 0.45

Tested by 1

TestRpczMethod · 0.64