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

Function HandleEchoResponse

example/auto_concurrency_limiter/client.cpp:89–107  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

87}
88
89void HandleEchoResponse(
90 brpc::Controller* cntl,
91 test::NotifyResponse* response) {
92 // std::unique_ptr makes sure cntl/response will be deleted before returning.
93 std::unique_ptr<brpc::Controller> cntl_guard(cntl);
94 std::unique_ptr<test::NotifyResponse> response_guard(response);
95
96 if (cntl->Failed() && cntl->ErrorCode() == brpc::ERPCTIMEDOUT) {
97 g_timeout.fetch_add(1, butil::memory_order_relaxed);
98 LOG_EVERY_N(INFO, 1000) << cntl->ErrorText();
99 } else if (cntl->Failed()) {
100 g_error.fetch_add(1, butil::memory_order_relaxed);
101 LOG_EVERY_N(INFO, 1000) << cntl->ErrorText();
102 } else {
103 g_succ.fetch_add(1, butil::memory_order_relaxed);
104 g_latency_rec << cntl->latency_us();
105 }
106
107}
108
109void Expose() {
110 g_timeout_bvar.expose_as("cl", "timeout");

Callers

nothing calls this directly

Calls 5

ErrorCodeMethod · 0.80
fetch_addMethod · 0.80
ErrorTextMethod · 0.80
latency_usMethod · 0.80
FailedMethod · 0.45

Tested by

no test coverage detected